Copy files recursively with grunt-ssh

1.6k views Asked by At

I try to use grunt-ssh for deployment. But I get only the files of the folder copied:

sftp: {
  deploy: {
    files: {
      "./": "doc/*"
    },
    options: {
      path: '<%= pkg.server.path %>',
      host: '<%= pkg.server.host %>',
      username: '<%= pkg.server.user %>',
      password: '<%= pkg.server.password %>',
      showProgress: true,
      srcBasePath: 'doc/'
    }
  }
}

How can I get the whole local folder including its subfolders (recursively) doc copied to the remote?

1

There are 1 answers

0
witrin On BEST ANSWER

Taking a quick look into the sources solved my problem:

sftp: {
  deploy: {
    files: {
      "./": "doc/**"
    },
    options: {
      path: '<%= pkg.server.path %>',
      host: '<%= pkg.server.host %>',
      username: '<%= pkg.server.user %>',
      password: '<%= pkg.server.password %>',
      showProgress: true,
      srcBasePath: 'doc/',
      createDirectories: true
    }
  }
}