Skip to content

Commit

Permalink
fix(v2): do not force terminate building when running deploy command
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Apr 1, 2020
1 parent 686c8ae commit 36484e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/docusaurus/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function compile(config: Configuration[]): Promise<any> {
export async function build(
siteDir: string,
cliOptions: Partial<BuildCLIOptions> = {},
forceTerminate: boolean = true,
): Promise<string> {
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
Expand Down Expand Up @@ -150,6 +151,6 @@ export async function build(
relativeDir,
)}.\n`,
);
!cliOptions.bundleAnalyzer && process.exit(0);
forceTerminate && !cliOptions.bundleAnalyzer && process.exit(0);
return outDir;
}
2 changes: 1 addition & 1 deletion packages/docusaurus/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function deploy(
fs.removeSync(tempDir);

// Build static html files, then push to deploymentBranch branch of specified repo.
build(siteDir, cliOptions)
build(siteDir, cliOptions, false)
.then(outDir => {
shell.cd(tempDir);

Expand Down

0 comments on commit 36484e9

Please sign in to comment.