Skip to content

Commit a791e5e

Browse files
authored
update some rimrafs (#44665)
1 parent 82a6395 commit a791e5e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/codeql-cli/scripts/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function setupEnvironment() {
7474
}
7575

7676
// refresh the temp directory
77-
rimraf.sync(TEMP_DIRECTORY)
77+
await rimraf(TEMP_DIRECTORY)
7878
await mkdirp(TEMP_DIRECTORY)
7979
}
8080

src/ghes-releases/scripts/archive-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ async function main() {
150150
}
151151

152152
// remove temp directory
153-
rimraf.sync(tmpArchivalDirectory)
153+
await rimraf(tmpArchivalDirectory)
154154

155155
const app = createApp()
156156
const server = http.createServer(app)

src/rest/scripts/update-files.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ main()
7272
async function main() {
7373
const pipelines = Array.isArray(output) ? output : [output]
7474
await validateInputParameters()
75-
rimraf.sync(TEMP_OPENAPI_DIR)
75+
await rimraf(TEMP_OPENAPI_DIR)
7676
await mkdirp(TEMP_OPENAPI_DIR)
7777

7878
// If the source repo is github, this is the local development workflow
@@ -97,7 +97,7 @@ async function main() {
9797
await copyFile(file, path.join(TEMP_OPENAPI_DIR, baseName))
9898
}
9999

100-
rimraf.sync(TEMP_BUNDLED_OPENAPI_DIR)
100+
await rimraf(TEMP_BUNDLED_OPENAPI_DIR)
101101
await normalizeDataVersionNames(TEMP_OPENAPI_DIR)
102102

103103
// The REST_API_DESCRIPTION_ROOT repo contains all current and
@@ -107,12 +107,12 @@ async function main() {
107107
const derefDir = await readdir(TEMP_OPENAPI_DIR)
108108
const currentOpenApiVersions = Object.values(allVersions).map((elem) => elem.openApiVersionName)
109109

110-
derefDir.forEach((schema) => {
110+
for (const schema of derefDir) {
111111
// if the schema does not start with a current version name, delete it
112112
if (!currentOpenApiVersions.find((version) => schema.startsWith(version))) {
113-
rimraf.sync(path.join(TEMP_OPENAPI_DIR, schema))
113+
await rimraf(path.join(TEMP_OPENAPI_DIR, schema))
114114
}
115-
})
115+
}
116116
}
117117
const derefFiles = await readdir(TEMP_OPENAPI_DIR)
118118
const { restSchemas, webhookSchemas } = await getOpenApiSchemaFiles(derefFiles)
@@ -175,7 +175,7 @@ async function getBundledFiles() {
175175
}
176176

177177
// Create a tmp directory to store schema files generated from github/github
178-
rimraf.sync(TEMP_OPENAPI_DIR)
178+
await rimraf(TEMP_OPENAPI_DIR)
179179
await mkdirp(TEMP_BUNDLED_OPENAPI_DIR)
180180

181181
console.log(

0 commit comments

Comments
 (0)