From 1e145948115bb327c770b976d5f66affdf9a658b Mon Sep 17 00:00:00 2001 From: Abner Chou Date: Thu, 8 Dec 2016 11:14:40 -0500 Subject: [PATCH] Update deployer.js --- lib/deployer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/deployer.js b/lib/deployer.js index 5d94dba..f95005b 100644 --- a/lib/deployer.js +++ b/lib/deployer.js @@ -24,6 +24,7 @@ module.exports = function(args) { var log = this.log; var message = commitMessage(args); var verbose = !args.silent; + var force = args.force_push || true; if (!args.repo && process.env.HEXO_DEPLOYER_REPO) { args.repo = process.env.HEXO_DEPLOYER_REPO; @@ -84,7 +85,7 @@ module.exports = function(args) { // Do nothing. It's OK if nothing to commit. }); }).then(function() { - return git('push', '-u', repo.url, 'HEAD:' + repo.branch, '--force'); + return git('push', '-u', repo.url, 'HEAD:' + repo.branch, (force ? '--force' : '')); }); }