From b054939da859767a1328abd280e84c56546b7c3e Mon Sep 17 00:00:00 2001 From: Phoenix Eve Aspacio Date: Fri, 17 Aug 2018 00:47:15 +0800 Subject: [PATCH] fix(ui): ensure demo post url is output correctly (#785) --- lib/tasks/major-update/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/major-update/ui.js b/lib/tasks/major-update/ui.js index 81f008463..a052266c3 100644 --- a/lib/tasks/major-update/ui.js +++ b/lib/tasks/major-update/ui.js @@ -22,7 +22,7 @@ module.exports = function ui(ctx) { ctx.ui.log(`${logSymbols.success} Your theme is compatible.\n`); if (demoPost && demoPost.uuid) { - const demoLink = `${ctx.instance.config.get('url')}p/${demoPost.uuid}/`; + const demoLink = `${ctx.instance.config.get('url').replace(/\/$/,'')}/p/${demoPost.uuid}/`; ctx.ui.log(`Visit the demo post at ${chalk.cyan(demoLink)} to see how your theme looks like in Ghost 2.0`); } @@ -133,7 +133,7 @@ module.exports = function ui(ctx) { } if (demoPost && demoPost.uuid) { - const demoLink = `${ctx.instance.config.get('url')}p/${demoPost.uuid}/`; + const demoLink = `${ctx.instance.config.get('url').replace(/\/$/,'')}/p/${demoPost.uuid}/`; ctx.ui.log(`Visit the demo post at ${chalk.cyan(demoLink)} to see how your theme looks like in Ghost 2.0`); }