File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-console */
2
2
import fsp from 'fs/promises' ;
3
+ import path from 'path' ;
3
4
4
5
import dotenv from 'dotenv' ;
5
6
import execa from 'execa' ;
6
- import { emptyDir , copy } from 'fs-extra' ;
7
+ import { copy , remove } from 'fs-extra' ;
7
8
import semver from 'semver' ;
8
9
import type { ReleaseType } from 'semver' ;
9
10
@@ -110,6 +111,14 @@ async function updateOpenApiTools(
110
111
) ;
111
112
}
112
113
114
+ async function emptyDirExceptForDotGit ( dir : string ) : Promise < void > {
115
+ for ( const file of await fsp . readdir ( dir ) ) {
116
+ if ( file !== '.git' ) {
117
+ await remove ( path . resolve ( dir , file ) ) ;
118
+ }
119
+ }
120
+ }
121
+
113
122
async function updateChangelog ( {
114
123
lang,
115
124
issueBody,
@@ -206,7 +215,7 @@ async function processRelease(): Promise<void> {
206
215
} ) ;
207
216
208
217
const clientPath = toAbsolutePath ( getLanguageFolder ( lang ) ) ;
209
- await emptyDir ( tempGitDir ) ;
218
+ await emptyDirExceptForDotGit ( tempGitDir ) ;
210
219
await copy ( clientPath , tempGitDir , { preserveTimestamps : true } ) ;
211
220
212
221
await configureGitHubAuthor ( tempGitDir ) ;
You can’t perform that action at this time.
0 commit comments