mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
feat(deploy): copy local git config to tmp repo (#7702)
This commit is contained in:
parent
07b6c200af
commit
ee376d19f6
1 changed files with 13 additions and 0 deletions
|
@ -183,6 +183,9 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
||||||
// Save the commit hash that triggers publish-gh-pages before checking
|
// Save the commit hash that triggers publish-gh-pages before checking
|
||||||
// out to deployment branch.
|
// out to deployment branch.
|
||||||
const currentCommit = shellExecLog('git rev-parse HEAD').stdout.trim();
|
const currentCommit = shellExecLog('git rev-parse HEAD').stdout.trim();
|
||||||
|
const currentGitRootDir = shellExecLog(
|
||||||
|
'git rev-parse --show-toplevel',
|
||||||
|
).stdout.trim();
|
||||||
|
|
||||||
const runDeploy = async (outputDirectory: string) => {
|
const runDeploy = async (outputDirectory: string) => {
|
||||||
const fromPath = outputDirectory;
|
const fromPath = outputDirectory;
|
||||||
|
@ -213,6 +216,16 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
|
||||||
logger.error`Copying build assets from path=${fromPath} to path=${toPath} failed.`;
|
logger.error`Copying build assets from path=${fromPath} to path=${toPath} failed.`;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gitConfigFromPath = path.join(currentGitRootDir, `.git`, `config`);
|
||||||
|
const gitConfigToPath = path.join(toPath, `.git`, `config`);
|
||||||
|
try {
|
||||||
|
await fs.copy(gitConfigFromPath, gitConfigToPath);
|
||||||
|
} catch (err) {
|
||||||
|
logger.error`Copying git config from path=${gitConfigFromPath} to path=${gitConfigToPath} failed.`;
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
shellExecLog('git add --all');
|
shellExecLog('git add --all');
|
||||||
|
|
||||||
const commitMessage =
|
const commitMessage =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue