mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
targetDir does not need to be part of the load context, it's just a CLI option
This commit is contained in:
parent
9de3abc821
commit
ac5e95a3f1
4 changed files with 3 additions and 10 deletions
1
packages/docusaurus-types/src/context.d.ts
vendored
1
packages/docusaurus-types/src/context.d.ts
vendored
|
@ -36,7 +36,6 @@ export type LoadContext = {
|
|||
siteConfig: DocusaurusConfig;
|
||||
siteConfigPath: string;
|
||||
outDir: string;
|
||||
targetDir: string;
|
||||
/**
|
||||
* Directory where all source translations for the current locale can be found
|
||||
* in. Constructed with `i18n.path` + `i18n.currentLocale.path` (e.g.
|
||||
|
|
|
@ -27,11 +27,6 @@ export const DOCUSAURUS_VERSION =
|
|||
*/
|
||||
export const DEFAULT_BUILD_DIR_NAME = 'build';
|
||||
|
||||
/**
|
||||
* Can be overridden with cli option `--target-dir`.
|
||||
*/
|
||||
export const DEFAULT_TARGET_DIR = '.';
|
||||
|
||||
/**
|
||||
* Can be overridden with cli option `--config`. Code should generally use
|
||||
* `context.siteConfigPath` instead (which is always absolute).
|
||||
|
|
|
@ -10,7 +10,6 @@ export {
|
|||
NODE_MINOR_VERSION,
|
||||
DOCUSAURUS_VERSION,
|
||||
DEFAULT_BUILD_DIR_NAME,
|
||||
DEFAULT_TARGET_DIR,
|
||||
DEFAULT_CONFIG_FILE_NAME,
|
||||
BABEL_CONFIG_FILE_NAME,
|
||||
GENERATED_FILES_DIR_NAME,
|
||||
|
|
|
@ -47,7 +47,7 @@ export async function deploy(
|
|||
): Promise<void> {
|
||||
const siteDir = await fs.realpath(siteDirParam);
|
||||
|
||||
const {outDir, siteConfig, siteConfigPath, targetDir} = await loadContext({
|
||||
const {outDir, siteConfig, siteConfigPath} = await loadContext({
|
||||
siteDir,
|
||||
config: cliOptions.config,
|
||||
outDir: cliOptions.outDir,
|
||||
|
@ -186,7 +186,7 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
|||
const currentCommit = shellExecLog('git rev-parse HEAD').stdout.trim();
|
||||
|
||||
const runDeploy = async (outputDirectory: string) => {
|
||||
const targetDirectory = cliOptions.targetDir;
|
||||
const targetDirectory = cliOptions.targetDir ?? '.';
|
||||
const fromPath = outputDirectory;
|
||||
const toPath = await fs.mkdtemp(
|
||||
path.join(os.tmpdir(), `${projectName}-${deploymentBranch}`),
|
||||
|
@ -264,6 +264,6 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
|||
}
|
||||
} else {
|
||||
// Push current build to deploymentBranch branch of specified repo.
|
||||
await runDeploy(outDir, targetDir);
|
||||
await runDeploy(outDir);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue