File tree 1 file changed +13
-0
lines changed
packages/docusaurus/src/commands
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,9 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
183
183
// Save the commit hash that triggers publish-gh-pages before checking
184
184
// out to deployment branch.
185
185
const currentCommit = shellExecLog ( 'git rev-parse HEAD' ) . stdout . trim ( ) ;
186
+ const currentGitRootDir = shellExecLog (
187
+ 'git rev-parse --show-toplevel' ,
188
+ ) . stdout . trim ( ) ;
186
189
187
190
const runDeploy = async ( outputDirectory : string ) => {
188
191
const fromPath = outputDirectory ;
@@ -213,6 +216,16 @@ You can also set the deploymentBranch property in docusaurus.config.js .`);
213
216
logger . error `Copying build assets from path=${ fromPath } to path=${ toPath } failed.` ;
214
217
throw err ;
215
218
}
219
+
220
+ const gitConfigFromPath = path . join ( currentGitRootDir , `.git` , `config` ) ;
221
+ const gitConfigToPath = path . join ( toPath , `.git` , `config` ) ;
222
+ try {
223
+ await fs . copy ( gitConfigFromPath , gitConfigToPath ) ;
224
+ } catch ( err ) {
225
+ logger . error `Copying git config from path=${ gitConfigFromPath } to path=${ gitConfigToPath } failed.` ;
226
+ throw err ;
227
+ }
228
+
216
229
shellExecLog ( 'git add --all' ) ;
217
230
218
231
const commitMessage =
You can’t perform that action at this time.
0 commit comments