We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is the function code:
findPackageJson = function(startingDirectory) { if (!startingDirectory) { return false; } if (fs.existsSync(startingDirectory + '/package.json')) { return startingDirectory + '/package.json'; } console.log(startingDirectory); return findPackageJson(startingDirectory.replace(/\/[^\/]+?$/g, '')); },
In my example, the startingDirectory is cli.js.
startingDirectory
cli.js
fs.existsSync(startingDirectory + '/package.json') is false, and then startingDirectory.replace(/\/[^\/]+?$/g, '') is cli.js again.
fs.existsSync(startingDirectory + '/package.json')
startingDirectory.replace(/\/[^\/]+?$/g, '')
The text was updated successfully, but these errors were encountered:
Btw, you don't need to rely on process.argv[1] (referenced above in SwaggerManager.js). See this page from docs:
process.argv[1]
the entry point of the current application can be obtained by checking require.main.filename.
require.main.filename
Sorry, something went wrong.
No branches or pull requests
This is the function code:
In my example, the
startingDirectory
iscli.js
.fs.existsSync(startingDirectory + '/package.json')
is false, and thenstartingDirectory.replace(/\/[^\/]+?$/g, '')
iscli.js
again.The text was updated successfully, but these errors were encountered: