File tree 4 files changed +9
-3
lines changed 4 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 25
25
"eslint" : " 8.12.0" ,
26
26
"execa" : " 5.1.1" ,
27
27
"folder-hash" : " 4.0.2" ,
28
+ "fs-extra" : " 10.0.1" ,
28
29
"inquirer" : " 8.2.2" ,
29
30
"jest" : " 27.5.1" ,
30
31
"js-yaml" : " 4.1.0" ,
Original file line number Diff line number Diff line change
1
+ import path from 'path' ;
2
+
1
3
import clientsConfig from '../../config/clients.config.json' ;
2
4
import config from '../../config/release.config.json' ;
3
5
import { getGitHubUrl , run } from '../common' ;
@@ -59,7 +61,7 @@ export async function cloneRepository({
59
61
const targetBranch = getTargetBranch ( lang ) ;
60
62
61
63
const gitHubUrl = getGitHubUrl ( lang , { token : githubToken } ) ;
62
- const tempGitDir = ` ${ tempDir } / ${ lang } ` ;
64
+ const tempGitDir = path . resolve ( tempDir , lang ) ;
63
65
await run ( `rm -rf ${ tempGitDir } ` ) ;
64
66
await run (
65
67
`git clone --depth 1 --branch ${ targetBranch } ${ gitHubUrl } ${ tempGitDir } `
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import fsp from 'fs/promises';
3
3
4
4
import dotenv from 'dotenv' ;
5
5
import execa from 'execa' ;
6
+ import { emptyDir , copy } from 'fs-extra' ;
6
7
import semver from 'semver' ;
7
8
import type { ReleaseType } from 'semver' ;
8
9
@@ -205,7 +206,8 @@ async function processRelease(): Promise<void> {
205
206
} ) ;
206
207
207
208
const clientPath = toAbsolutePath ( getLanguageFolder ( lang ) ) ;
208
- await run ( `cp -r ${ clientPath } / ${ tempGitDir } ` ) ;
209
+ await emptyDir ( tempGitDir ) ;
210
+ await copy ( clientPath , tempGitDir , { preserveTimestamps : true } ) ;
209
211
210
212
await configureGitHubAuthor ( tempGitDir ) ;
211
213
await run ( `git add .` , { cwd : tempGitDir } ) ;
Original file line number Diff line number Diff line change @@ -10967,7 +10967,7 @@ __metadata:
10967
10967
languageName: node
10968
10968
linkType: hard
10969
10969
10970
- "fs-extra@npm:^10.0.1":
10970
+ "fs-extra@npm:10.0.1, fs-extra@npm: ^10.0.1":
10971
10971
version: 10.0.1
10972
10972
resolution: "fs-extra@npm:10.0.1"
10973
10973
dependencies:
@@ -18835,6 +18835,7 @@ __metadata:
18835
18835
eslint: 8.12.0
18836
18836
execa: 5.1.1
18837
18837
folder-hash: 4.0.2
18838
+ fs-extra: 10.0.1
18838
18839
inquirer: 8.2.2
18839
18840
jest: 27.5.1
18840
18841
js-yaml: 4.1.0
You can’t perform that action at this time.
0 commit comments