commitlint: Error: ENOENT: no such file or directory, open 'F:\Flat Projects\aquasoft\$GIT_PARAMS' on Windows

Hello, I am presented with this error when calling the script "commitmsg ":"commitlint -e $GIT_PARAMS".

I do not know if any other configuration is required that I do not know.

I hope you can help me, and thank you very much in advance.

image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Released via 5.2.3

Okay, we’ll have to implement a rather grungy fix for this, along the lines of

function normalizeEdit(edit) {
  if (typeof edit === 'boolean') {
     return edit;
  }
  if (edit === '$GIT_PARARMS' || edit === '%GIT_PARAMS%') {
    if (!'GIT_PARAMS' in process.env) {
       throw new Error(`Received ${edit} as value for -e | --edit, but GIT_PARAMS is not available globally.`);
    }
    return process.env.GIT_PARAMS;
  }
  return edit;
}

@kumarharsh Would you consider contributing a the fix for this as outlined via https://github.com/marionebl/commitlint/issues/103#issuecomment-346318328?

This would spare you from creating the js proxy file you mentioned and benefit other users down the line.

Also failed with this error in git bash on windows "commitmsg": "commitlint -e" works for me

The echo ... command is indeed only tested on bash.

I do not have access to win32 machines very often, so this is hard to test for me.

$GIT_PARAMS is intended to be used with husky. If you do not plan to use husky, just

commitlint -e

should be sufficient.