Skip to content

Commit

Permalink
misc(v2): revert some stuff in facebook#2556
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun committed Apr 8, 2020
1 parent 04a420d commit 1766ed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
9 changes: 3 additions & 6 deletions packages/docusaurus/bin/docusaurus.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ cli
.description('Build website')
.option(
'--bundle-analyzer',
'Visualize size of webpack output files with an interactive zoomable treemap (default: disabled)',
'Visualize size of webpack output files with an interactive zoomable treemap (default: false)',
)
.option(
'--out-dir <dir>',
'The full path for the new output directory, relative to the current workspace (default: build).',
)
.option(
'--no-minify',
'Build website without minimizing JS bundles (default: minification enabled)',
'Build website without minimizing JS bundles (default: false)',
)
.action((siteDir = '.', {bundleAnalyzer, outDir, minify}) => {
wrapCommand(build)(path.resolve(siteDir), {
Expand Down Expand Up @@ -84,10 +84,7 @@ cli
'--hot-only',
'Do not fallback to page refresh if hot reload fails (default: false)',
)
.option(
'--no-open',
'Do not open page in the browser (default: opening enabled)',
)
.option('--no-open', 'Do not open page in the browser (default: false)')
.action((siteDir = '.', {port, host, hotOnly, open}) => {
wrapCommand(start)(path.resolve(siteDir), {
port,
Expand Down
19 changes: 6 additions & 13 deletions packages/docusaurus/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,12 @@ 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.
let websiteURL = '';
if (githubHost === 'github.com') {
// github.io hosting
if (projectName.includes('.github.io')) {
// domain root gh-pages hosted repo
websiteURL = `https://${organizationName}.github.io/`;
} else {
websiteURL = `https://${organizationName}.github.io/${projectName}/`;
}
} else {
// GitHub enterprise hosting.
websiteURL = `https://${githubHost}/pages/${organizationName}/${projectName}/`;
}
const websiteURL =
githubHost === 'github.com'
? // gh-pages hosted repo
`https://${organizationName}.github.io/${projectName}`
: // GitHub enterprise hosting.
`https://${githubHost}/pages/${organizationName}/${projectName}`;
shell.echo(`Website is live at ${websiteURL}`);
shell.exit(0);
}
Expand Down

0 comments on commit 1766ed0

Please sign in to comment.