Skip to content
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

cwd option in generated hooks make the hook fail on Windows #7

Closed
romaricpascal opened this issue Oct 8, 2013 · 4 comments
Closed
Labels

Comments

@romaricpascal
Copy link
Contributor

The cwd option introduced to let grunt run properly when the Gruntfile.js is not at the root of the Git folder makes the hook fail when run on Windows :(

Using version 0.1.0 will work on Windows if the Gruntfile is in the root folder. Having the Gruntfile in another folder works on Linux (and probs Mac Os?). Will need to find a way of to make things work on Windows when the Gruntfile is not at the root of Git folder.

@romaricpascal
Copy link
Contributor Author

Note for self: \ might need a bit of escaping when on Windows. See if it's not the cause of the issue.

@andrewjmead
Copy link

PS. I would be happy to help debug this issue. I operate on windows 7 most days.

@andrewjmead
Copy link

The \ is 100% the issue. I was able to update pre-commit running version 0.2.0, and everything was working.

Manual Update Below:

#!/usr/bin/env node

// GRUNT-GITHOOKS START
var exec = require('child_process').exec;

exec('grunt test', {
       cwd: 'c:\\code\\auto-test'
     }, function (err, stdout, stderr) {

  console.log(stdout);

  var exitCode = 0;
  if (err) {
    console.log(stderr);
    exitCode = -1;
  }

  process.exit(exitCode);
});
// GRUNT-GITHOOKS END

@romaricpascal
Copy link
Contributor Author

The master branch now has this fixed. I'll make a new release once I've sorted out #8 so it is easier to use from NPM. In the meantime, you can use d1fc833 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants