Skip to content

Commit

Permalink
CWD causes the script to bail when it's not set
Browse files Browse the repository at this point in the history
`fileObj.orig.cwd` can returned undefined which will kill the `path.relative` call with a warning. This gives it a default empty string to base the relative off of.
  • Loading branch information
geedew committed Mar 4, 2015
1 parent be1b78e commit f55ac33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/scp.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = function(grunt) {
filename = filepath;
filepath = path.join(fileObj.cwd, filepath);
} else {
filename = path.relative(fileObj.orig.cwd, filepath);
filename = path.relative(fileObj.orig.cwd || '', filepath);
}
destfile = path.join(fileObj.dest, filename);
client.upload(filepath, destfile, cb);
Expand Down

0 comments on commit f55ac33

Please sign in to comment.