-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(ut): Add test #45
base: main
Are you sure you want to change the base?
Conversation
config = require(path.resolve(configFile)); | ||
if (!config) { | ||
config = require(path.resolve(configFile)); | ||
} |
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.
Can we only read config from _config? Use Object.assign?
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.
We still want to support the config file way,
So the user doesn't have to write js, if they prefer cli
@@ -110,7 +117,8 @@ async function init() { | |||
}, | |||
tokenPath: '.', | |||
} | |||
await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8'); | |||
|
|||
return _dry ? config : await fs.writeFile(configFile, `module.exports = ${JSON.stringify(config, null, 2)}`, 'utf-8'); |
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.
Do we need print config if we use dry mode?
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.
The init would return the config in dry run,
How to use the return stuff would up to the user,
For issue: #35
Not cover yet