Skip to content

Commit

Permalink
Merge pull request #21 from zklhp/patch-1
Browse files Browse the repository at this point in the history
Wrokaround wrong public path for w32
  • Loading branch information
Xuanwo authored Jul 26, 2016
2 parents 4e05a72 + aa5ce0b commit b81fb8e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var chalk = require('chalk');
var spawn = require('hexo-util/lib/spawn');
var pathFn = require('path');

module.exports = function(args) {
if (!args.host || !args.user || !args.root) {
Expand Down Expand Up @@ -31,14 +32,15 @@ module.exports = function(args) {

var params = [
'-az',
this.public_dir,
process.platform === 'win32' ? pathFn.basename(this.public_dir) + '/' : this.public_dir,
args.user + '@' + args.host + ':' + args.root
];

if (args.port && args.port > 0 && args.port < 65536){
params.splice(params.length - 2, 0, '-e');
params.splice(params.length - 2, 0, 'ssh -p ' + args.port);
if (args.port && args.port > 0 && args.port < 65536) {
params.splice(params.length - 2, 0, '-e');
params.splice(params.length - 2, 0, 'ssh -p ' + args.port);
}

if (args.verbose) params.unshift('-v');
if (args.ignore_errors) params.unshift('--ignore-errors');
if (args.delete) params.unshift('--delete');
Expand Down

0 comments on commit b81fb8e

Please sign in to comment.