Skip to content

Commit

Permalink
refactor: use fs.rm instead of fs.rmdir
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Jul 11, 2024
1 parent e8e27f1 commit f0bc530
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions runtime-shell/web/deploy-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ async function patchAssetPath(options) {
}

// Clean up folders without force-deleting it, if anything is left, it should fail on this part.
await fs.rmdir(path.resolve(exportPath, 'v2', String(semver.major(expoVersion)), 'assets'));
await fs.rmdir(path.resolve(exportPath, 'v2', String(semver.major(expoVersion))));
await fs.rmdir(path.resolve(exportPath, 'v2'));
await fs.rm(path.resolve(exportPath, 'v2', String(semver.major(expoVersion)), 'assets'), {
recursive: true,
});
await fs.rm(path.resolve(exportPath, 'v2', String(semver.major(expoVersion))), {
recursive: true,
});
await fs.rm(path.resolve(exportPath, 'v2'), { recursive: true });

console.log(`✅ Moved ${filesOrFolders.length} public assets`);
}
Expand Down
2 changes: 1 addition & 1 deletion snackager/src/__e2e__/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('/serve', () => {

afterEach(() => {
process.env.DEBUG_LOCAL_FILES = originalEnv;
fs.rmdirSync(directory, { recursive: true });
fs.rmSync(directory, { recursive: true });
});

it('doesnt serve local files by default', async () => {
Expand Down

0 comments on commit f0bc530

Please sign in to comment.