简体   繁体   中英

grunt-ssh gives - Error: no such file while upload

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:

directoryPermissions: parseInt('755', 8)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM