Skip to content

Commit

Permalink
add trailing slash to path if needed. Fixes #40
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrjones committed Dec 6, 2013
1 parent 0bd69ff commit 3917483
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module.exports = function (grunt) {
"./": "tasks/**/*.js"
},
options: {
path: '/tmp',
host: '<%= secret.host %>',
username: '<%= secret.username %>',
// password auth
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Determins if the task should stop or continue if any of the commands returns a c
If true only display remote error messages if Grunt is run with the --verbose flag.
## Release History
* 2013/11/29 - v0.9.0 - [#28:](https://github.com/andrewrjones/grunt-ssh/issues/28) Pseudo-TTY support.
* 2013/XX/XX - v0.9.0 - [#28:](https://github.com/andrewrjones/grunt-ssh/issues/28) Pseudo-TTY support; [#40:](https://github.com/andrewrjones/grunt-ssh/issues/40) Add trailing slash to path if needed.
* 2013/11/17 - v0.8.0 - [#33:](https://github.com/andrewrjones/grunt-ssh/pull/33) File counter for `sftp` and `suppressRemoteErrors` option for `sshexec` ([David J. Bradshaw](https://github.com/davidjbradshaw)); [#34:](https://github.com/andrewrjones/grunt-ssh/pull/34) Use stat() instead of opendir() for checking existence of a dir ([Harri Hälikkä](https://github.com/harriha)); [#38:](https://github.com/andrewrjones/grunt-ssh/pull/34) Doc updates ([Alexandre Richonnier](https://github.com/heralight)).
* 2013/10/17 - v0.7.0 - [#32:](https://github.com/andrewrjones/grunt-ssh/pull/32) Added command line options for username, password and passphrase ([David J. Bradshaw](https://github.com/davidjbradshaw)); Doc updates.
* 2013/09/25 - v0.6.2 - Allow sftp task to use the shared sshconfig; Allow overriding sshconfig properties in the task config ([Andy Royle](https://github.com/andyroyle)). Document using the private key with `sshexec`.
Expand Down
5 changes: 5 additions & 0 deletions tasks/sftp.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ module.exports = function (grunt) {
setOption('password');
setOption('passphrase');

// add trailing slash to path if needed
if (!options.path.match(/(\/|\\)$/)) {
options.path = options.path + '/';
}

grunt.verbose.writeflags(options, 'Options');

var files = this.files;
Expand Down

0 comments on commit 3917483

Please sign in to comment.