-
Notifications
You must be signed in to change notification settings - Fork 1
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
Warn override #25
Warn override #25
Conversation
Will add unit tests |
* Also add my name in the contributors.
And now with unit tests |
lib/commands/configure/index.js
Outdated
|
||
const configure = async() => { | ||
if(await checkConfigExists()){ | ||
console.log(chalk.red.bold('⚠️ Mergify is already configured. Configuring again will override the existing 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.
Can you use the logger for this. It's located at lib/utils/logger
lib/utils/checkConfigExists/index.js
Outdated
|
||
async function checkConfigExists() { | ||
try { | ||
const configFileName = `${__dirname}/../../../.config`; |
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.
Since this is the third time we're getting this path maybe we should put it somewhere else.
I'm thinking a function getConfigPath()
would do good here.
Then also readConfig
and writeConfig
should be updated.
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.
Agreed, I was thinking the same. Maybe even actually have a single config module with wrte/read and check in the same file / folder.
@@ -0,0 +1,27 @@ | |||
const {checkConfigExists} = require('./index.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.
There should be spaces surrounding the require like so:
const { checkConfigExists } = require('./index');
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.
Let's add linting per default as a pre commit hook then :)
package-lock.json
Outdated
@@ -0,0 +1,7111 @@ | |||
{ |
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.
Because I've decided to use yarn
I don't want to have package-lock files in the repo.
It's confusing and unclear which lockfile is the main source of truth.
@RamonGebben all comments processed |
Fixes #17 .
Adds a warning message if the user tries to configure mergify again