Skip to content

Commit 0d7ca16

Browse files
authored
Fix deprecation warning about fs.rmdirSync(path, { recursive: true }) (#1254)
Logs from running this action ([example](https://github.com/github/dependabot-action/actions/runs/9784790222/job/27016465395#step:3:155)): ``` (node:1631) [DEP0147] DeprecationWarning: In future versions of Node.js, fs.rmdir(path, { recursive: true }) will be removed. Use fs.rm(path, { recursive: true }) instead (Use `node --trace-deprecation ...` to show where the warning was created) ``` Relevant docs: https://nodejs.org/api/fs.html#fsrmdirsyncpath-options This deprecation landed in Node 16.
1 parent 7ec3c13 commit 0d7ca16

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Diff for: __tests__/updater-builder-integration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ integration('UpdaterBuilder', () => {
4545

4646
afterEach(async () => {
4747
await removeDanglingUpdaterContainers()
48-
fs.rmdirSync(workingDirectory, {recursive: true})
48+
fs.rmSync(workingDirectory, {recursive: true})
4949
})
5050

5151
it('createUpdaterContainer returns a container only connected to the internal network', async () => {

Diff for: __tests__/updater-integration.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ integration('Updater', () => {
6464
afterEach(async () => {
6565
server && server() // teardown server process
6666
await removeDanglingUpdaterContainers()
67-
fs.rmdirSync(workingDirectory, {recursive: true})
67+
fs.rmSync(workingDirectory, {recursive: true})
6868
})
6969

7070
jest.setTimeout(120000)

Diff for: __tests__/updater.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('Updater', () => {
7676

7777
afterEach(async () => {
7878
jest.clearAllMocks() // Reset any mocked classes
79-
fs.rmdirSync(workingDirectory, {recursive: true})
79+
fs.rmSync(workingDirectory, {recursive: true})
8080
})
8181

8282
describe('when there is a happy path update', () => {

Diff for: dist/main/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/main/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/updater.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ export class Updater {
8585
await proxy.shutdown()
8686

8787
if (fs.existsSync(this.outputHostPath)) {
88-
fs.rmdirSync(this.outputHostPath, {recursive: true})
88+
fs.rmSync(this.outputHostPath, {recursive: true})
8989
}
9090

9191
if (fs.existsSync(this.repoHostPath)) {
92-
fs.rmdirSync(this.repoHostPath, {recursive: true})
92+
fs.rmSync(this.repoHostPath, {recursive: true})
9393
}
9494
}
9595
}

0 commit comments

Comments
 (0)