luozhihua / grunt-commands

Execute commands or batch files in Grunt
Other
8 stars 5 forks source link

Silently fails #4

Open peey opened 10 years ago

peey commented 10 years ago

I'm on Windows 7 64-bit. I added the following code to mu gruntfile.js:

command : {
      run_bat: {
        type : 'bat',
        cmd  : 'test.bat'
      },
      run_cmd: {
        cmd: ['rm G:/test/test.txt']
      }
}

and

  grunt.loadNpmTasks('grunt-contrib-commands');

This is what command line shows :

G:\test > grunt command
Running "command:run_bat" (command) task
os type: Windows_NT

but the command does not execute.

The contents of batch file are :

rm G:/test/test.txt

And it works fine when executed via windows command line

lukasoppermann commented 10 years ago

Same problem here with build.shon mac.

build.sh

touch readmeNew.md

My task

build: {
  type: 'shell',
  cmd  : 'build.sh'
}

If I change it to ./build.shit does not work either. How do those paths have to be set anyway?

lukasoppermann commented 10 years ago

A workaround for now is to run the script from the build command like so:

  cmd: [
    'source grunt-tasks/custom-options/build.sh',
  ]
isobar-ranesco commented 9 years ago

I'm getting the same thing, running the task does not execute the bat file