i have problems using the grunt-ssh plugin. So far i've written a testcode to check the functionality before using it in the real environment. This is my gruntfile:
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 straight forward and works so i won't post it here.
My question is, why grunt gives me an error which looks like the following:
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 option the gruntfile adds the right folders in the right place but no file will be copied. So I guess the permissions are right.
Could it have something to do with my operating System is Windows and i upload to a Unix Server? The folder structure with createDirectories option is right though...
Thanks for your help in advance guys!
Meybe it's because of directoryPermissions. You should try this one: