I am trying to FTP files from local distribution build to production using Grunt. I have tested by bash file and it works. I just can't get it to run using grunt.
In my grunt file:
/*global module:false*/
module.exports = function(grunt) {
grunt.initConfig( {
...
exec: {
ftpupload: {
command: 'ftp.sh'
}
}
} );
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('deploy', ['ftpupload']);
};
I try grunt deploy
at the command line and get the following error:
Warning: Task "ftpupload" not found. Use --force to continue.
I try grunt exec
at the command line and get the following error:
Running "exec:ftpupload" (exec) task
>> /bin/sh: ftp.sh: command not found
>> Exited with code: 127.
>> Error executing child process: Error: Process exited with code 127.
Warning: Task "exec:ftpupload" failed. Use --force to continue.
The ftp.sh
file resides in the same directory as Gruntfile.js
.
How can I configure it so that I can run grunt deploy
and have the bash script run?