-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
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
CLI: use .hyper.js from repo root dir when running in dev mode #2792
Conversation
Thank you for this first contribution 🙏 But some part must be modified: We don't need a new config file. We need to have exactly same behavior with CLI than with Hyper. If it is in dev mode, it checks the existence of config file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove new config file and use a potential one in repository root directory
oops... sorry about that 👼 ..please see latest commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, it works when you execute cli.js
in bin
directory. But executing: node bin/cli.js
doesn't work, due to relative path usage
cli/api.js
Outdated
@@ -5,7 +5,12 @@ const registryUrl = require('registry-url')(); | |||
const pify = require('pify'); | |||
const recast = require('recast'); | |||
|
|||
const fileName = `${os.homedir()}/.hyper.js`; | |||
const devConfigFileName = '../.hyper.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to resolve this path with something like __dirname. It should not be impacted by the current working directory.
Used |
Ready to be merged automatically.
I went with process.env.NODE_ENV because it is set automatically to 'production' when running in..well..production.
Thank you so much ! if I missed anything be sure to let me know please :)
1st contribution!