Skip to content

Commit a10146b

Browse files
authored
Merge pull request #873 from googleapis/fix/838
fix(pack-n-play): replace rimraf with native Node.js fs.promises.rm
2 parents 1010912 + 84f2c33 commit a10146b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

dev-packages/pack-n-play/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"execa": "^5.0.0",
5050
"npm-packlist": "^9.0.0",
5151
"once": "^1.4.0",
52-
"rimraf": "^5.0.1",
5352
"tar": "^7.4.3",
5453
"tmp": "^0.2.3"
5554
},

dev-packages/pack-n-play/src/pack-n-test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import * as Arborist from '@npmcli/arborist';
1919
import * as packlist from 'npm-packlist';
2020
import * as path from 'path';
2121
import * as tar from 'tar';
22-
import {writeFile} from 'fs/promises';
22+
import * as fs from 'fs/promises';
2323
import * as tmp from 'tmp';
24-
import {rimraf} from 'rimraf';
2524

2625
// The way the user defines what type of input they're using for their code
2726
// block is via a property name that reflects either the file extension or
@@ -118,7 +117,7 @@ export async function packNTest(options: TestOptions) {
118117
console.error(err);
119118
throw err;
120119
} finally {
121-
await rimraf(installDir);
120+
await fs.rm(installDir, {recursive: true});
122121
}
123122
return;
124123

@@ -156,7 +155,7 @@ export async function packNTest(options: TestOptions) {
156155

157156
// Populate test code.
158157
const {code, filename} = getSample(sample);
159-
await writeFile(path.join(installDir, filename), code, 'utf-8');
158+
await fs.writeFile(path.join(installDir, filename), code, 'utf-8');
160159

161160
if (sample.ts) {
162161
const testConfig = {
@@ -170,7 +169,7 @@ export async function packNTest(options: TestOptions) {
170169
};
171170

172171
// this is the config `tsc` will use for compilation locally.
173-
await writeFile(
172+
await fs.writeFile(
174173
path.join(installDir, 'tsconfig.json'),
175174
JSON.stringify(testConfig),
176175
);

0 commit comments

Comments
 (0)