• I'm trying to run the console command "grunt" in my GitHub repository folder every time a new commit is created using GitHub Desktop (this is to link the GitHub repository's code to my Screeps account).

    I've created a new file in .git/hooks "post-commit" which has the following code:

    #!/bin/sh
    exec node -e "require('grunt').cli();"
    

    How can I run Grunt automatically with every commit?



  • Try replacing the exec command with npx grunt.



  • @jbyoshi said:

    npx grunt

    No luck, unfortunately!

    In general, is there any way to automate grunt, so that every time something happens (code gets pushed, or commit) grunt runs and also pushes the code to Screeps?



  • Did you turn on execute permissions on the file? chmod u+x path/to/file