From 1f0e59f0dc960ffeb2e4d7215429406c39e75260 Mon Sep 17 00:00:00 2001 From: Ryuichi Okumura Date: Sat, 5 Oct 2019 00:51:58 +0900 Subject: [PATCH 1/2] Allow an absolute path as dist directory Fixes: #317 --- bin/gh-pages.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/gh-pages.js b/bin/gh-pages.js index 8ff652cc..1314dbd1 100755 --- a/bin/gh-pages.js +++ b/bin/gh-pages.js @@ -8,7 +8,10 @@ const addr = require('email-addresses'); function publish(config) { return new Promise((resolve, reject) => { - const basePath = path.join(process.cwd(), program.dist); + let basePath = program.dist; + if (!program.dist.startsWith('/')) { + basePath = path.join(process.cwd(), program.dist); + } ghpages.publish(basePath, config, err => { if (err) { return reject(err); From 1f313c747c79d649519ac5ebeb49dd2abb532710 Mon Sep 17 00:00:00 2001 From: Ryuichi Okumura Date: Sat, 7 Dec 2019 00:22:30 +0900 Subject: [PATCH 2/2] Use path.resolve() instead --- bin/gh-pages.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/gh-pages.js b/bin/gh-pages.js index 1314dbd1..15f8ec61 100755 --- a/bin/gh-pages.js +++ b/bin/gh-pages.js @@ -8,10 +8,7 @@ const addr = require('email-addresses'); function publish(config) { return new Promise((resolve, reject) => { - let basePath = program.dist; - if (!program.dist.startsWith('/')) { - basePath = path.join(process.cwd(), program.dist); - } + const basePath = path.resolve(process.cwd(), program.dist); ghpages.publish(basePath, config, err => { if (err) { return reject(err);