Skip to content

Commit

Permalink
feat(*): update demo script
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Fenko committed Feb 19, 2020
1 parent b5d1c00 commit 46d600c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/demo-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const execOptions = {
fatal: true
};
/** Temporary dir for builded file = last git commit hash */
const tempOutputDir = shell.exec('git rev-parse HEAD', execOptions).stdout;
const tempOutputDir = shell.exec('git rev-parse HEAD', execOptions).stdout.trim();
/** Current git branch */
const sourceBranch = shell.exec('git rev-parse --abbrev-ref HEAD', execOptions).stdout.trim();
/** Git remote url */
Expand All @@ -28,6 +28,7 @@ const gitUrl = shell.exec(
).stdout.trim();
/** Parsed git url */
const parsedGitUrl = parseGitUrl(gitUrl);
const gitPagesUrl = `https://${parsedGitUrl.owner}.github.io/${parsedGitUrl.name}`;

console.log('Publish storybook demo for github');
console.log('=> Build storybook');
Expand Down Expand Up @@ -70,7 +71,7 @@ shell.exec(`git commit -m "${defaultConfig.commitMessage}"`, execOptions);

// log output url
if (sourceBranch === 'master') {
console.log(`=> Storybook deployed to: https://${parsedGitUrl.owner}.github.io/${parsedGitUrl.name}/master/`);
console.log(`=> Storybook deployed to: ${gitPagesUrl}/master/`);
} else {
console.log(`=> Storybook deployed to: https://${parsedGitUrl.owner}.github.io/${parsedGitUrl.name}/${tempOutputDir}/`);
console.log(`=> Storybook deployed to: ${gitPagesUrl}/${tempOutputDir}/`);
}

0 comments on commit 46d600c

Please sign in to comment.