Grunt-ssh gives - Error: No such file on upload
I'm having problems using the grunt-ssh plugin. So far I have written test code to test the functionality before using it in a real environment. This is my grunt file:
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
secret: grunt.file.readJSON('secret.json'),
sftp: {
test: {
files: {
"./": "Data/**/*.css"
},
options: {
path: 'TEST/',
host: '<%= secret.host %>',
username: '<%= secret.username %>',
privateKey: "<%= grunt.file.read(secret.key) %>"//,
//createDirectories: true
}
}
}
});
grunt.loadNpmTasks('grunt-ssh');
// Default task(s).
grunt.registerTask('default', ['sftp:test']);
};
The secret.json is straightforward and works, so I won't post it here.
My question is why is grunt giving me an error that looks like this:
Connection :: connect
copying Data/test1/test.css to TEST/Data/test1/test.css
>> Error: No such file
Connection :: end
Copied
Connection :: close
SFTP :: session end
If I uncomment the createDirectories parameter, the grunt file adds the correct folders in the correct location, but the file is not copied. So I am assuming the rights are correct.
Could it have something to do with my operating system and Windows is booting into a Unix server? The folder structure with the createDirectories parameter is right though ...
Thanks for your help in advance guys!
+3
source to share