Skip to content

Commit

Permalink
fix(v2): properly link top-level github pages sites in deploy command (
Browse files Browse the repository at this point in the history
…#2558)

* fix(v2): properly link top-level github pages sites in deploy command

* Apply style

* prettier format
  • Loading branch information
RDIL authored Apr 12, 2020
1 parent c663d7c commit 354c1d3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/docusaurus/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,15 @@ export async function deploy(
throw new Error('Error: Git push failed');
} else if (commitResults.code === 0) {
// The commit might return a non-zero value when site is up to date.
const websiteURL =
githubHost === 'github.com'
? // gh-pages hosted repo
`https://${organizationName}.github.io/${projectName}`
: // GitHub enterprise hosting.
`https://${githubHost}/pages/${organizationName}/${projectName}`;
let websiteURL = '';
if (githubHost === 'github.com') {
websiteURL = projectName.includes('.github.io')
? `https://${organizationName}.github.io/`
: `https://${organizationName}.github.io/${projectName}/`;
} else {
// GitHub enterprise hosting.
websiteURL = `https://${githubHost}/pages/${organizationName}/${projectName}/`;
}
shell.echo(`Website is live at ${websiteURL}`);
shell.exit(0);
}
Expand Down

0 comments on commit 354c1d3

Please sign in to comment.