Skip to content

Commit a7f9314

Browse files
committed
chore: fix api
1 parent 0b286f5 commit a7f9314

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/commands/functions/functions-create.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fileURLToPath, pathToFileURL } from 'url'
99
import { promisify } from 'util'
1010

1111
import copyTemplateDirOriginal from 'copy-template-dir'
12-
import findUp from 'find-up'
12+
import { findUp } from 'find-up'
1313
import fuzzy from 'fuzzy'
1414
import inquirer from 'inquirer'
1515
import inquirerAutocompletePrompt from 'inquirer-autocomplete-prompt'

src/lib/functions/runtimes/rust/index.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { readFile } from 'fs/promises'
33
import { dirname, extname, join, resolve } from 'path'
44
import { platform } from 'process'
55

6-
import findUp from 'find-up'
6+
import { findUp } from 'find-up'
77
import toml from 'toml'
88

99
import execa from '../../../../utils/execa.mjs'

src/utils/get-repo-data.mjs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { dirname } from 'path'
33
import process from 'process'
44
import util from 'util'
55

6-
import findUp from 'find-up'
6+
import { findUp } from 'find-up'
77
import gitRepoInfo from 'git-repo-info'
88
import gitconfiglocal from 'gitconfiglocal'
99
import parseGitRemote from 'parse-github-url'
@@ -23,16 +23,17 @@ const getRepoData = async function ({ remoteName } = {}) {
2323
util.promisify(gitconfiglocal)(cwd),
2424
findUp('.git', { cwd, type: 'directory' }),
2525
])
26+
27+
if (!gitDirectory || !gitConfig || !gitConfig.remote || Object.keys(gitConfig.remote).length === 0) {
28+
throw new Error('No Git remote found')
29+
}
30+
2631
const baseGitPath = dirname(gitDirectory)
2732

2833
if (cwd !== baseGitPath) {
2934
log(`Git directory located in ${baseGitPath}`)
3035
}
3136

32-
if (!gitConfig || !gitConfig.remote || Object.keys(gitConfig.remote).length === 0) {
33-
throw new Error('No Git remote found')
34-
}
35-
3637
if (!remoteName) {
3738
const remotes = Object.keys(gitConfig.remote)
3839
remoteName = remotes.find((remote) => remote === 'origin') || remotes[0]

src/utils/state-config.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'path'
33
import process from 'process'
44

55
import dotProp from 'dot-prop'
6-
import findUp from 'find-up'
6+
import { findUpSync } from 'find-up'
77
import writeFileAtomic from 'write-file-atomic'
88

99
import { getPathInProject } from '../lib/settings.mjs'
@@ -13,7 +13,7 @@ const permissionError = "You don't have access to this file."
1313

1414
// Finds location of `.netlify/state.json`
1515
const findStatePath = (cwd) => {
16-
const statePath = findUp.sync([STATE_PATH], { cwd })
16+
const statePath = findUpSync([STATE_PATH], { cwd })
1717

1818
if (!statePath) {
1919
return path.join(cwd, STATE_PATH)

0 commit comments

Comments
 (0)