added public_dir variable (available in the next release of hexo)

This commit is contained in:
Florian Cargoët
2013-11-26 22:25:07 +01:00
parent 345a6e2728
commit 3153e87748

View File

@@ -1,5 +1,7 @@
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var public_dir = hexo.config.public_dir || './public';
// run function which supports interactive commands // run function which supports interactive commands
function run (command, args, callback) { function run (command, args, callback) {
process.stdin.pause(); process.stdin.pause();
@@ -38,7 +40,7 @@ hexo.extend.deployer.register('ftp', function (args, callback) {
var args = [ var args = [
'-e', '-e',
'mirror -R --ignore-time --delete -v ./public ' + config.root + '; bye', 'mirror -R --ignore-time --delete -v ' + public_dir + ' ' + config.root + '; bye',
'-u', '-u',
config.user, config.user,
config.host config.host
@@ -47,4 +49,4 @@ hexo.extend.deployer.register('ftp', function (args, callback) {
run('lftp', args, function (code) { run('lftp', args, function (code) {
callback(); callback();
}); });
}); });