From 1489e946332f6cba69e4be5fe0b66e798b8a23ce Mon Sep 17 00:00:00 2001 From: JupiterPi Date: Sat, 28 Dec 2024 16:34:19 +0100 Subject: [PATCH] fix: navigate back to previous directory after SEA build (#131) * fix: navigate back to previous directory after SEA build * fix: lint issues --- lib/sea.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sea.ts b/lib/sea.ts index 1210ece5..c637453c 100644 --- a/lib/sea.ts +++ b/lib/sea.ts @@ -358,6 +358,7 @@ export default async function sea(entryPoint: string, opts: SeaOptions) { await mkdir(tmpDir, { recursive: true }); + const previousDirectory = process.cwd(); try { // change working directory to the temp directory process.chdir(tmpDir); @@ -416,5 +417,7 @@ export default async function sea(entryPoint: string, opts: SeaOptions) { await rm(tmpDir, { recursive: true }).catch(() => { log.warn(`Failed to cleanup the temp directory ${tmpDir}`); }); + + process.chdir(previousDirectory); } }