From 3694f2af4d2b2bfc3e0e4a101b54d5eaad68c0a2 Mon Sep 17 00:00:00 2001 From: JupiterPi Date: Fri, 27 Dec 2024 01:23:28 +0100 Subject: [PATCH 1/2] fix: navigate back to previous directory after SEA build --- lib/sea.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sea.ts b/lib/sea.ts index 1210ece5..d4a78993 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); } } From f90720d3b9a14cb0648e75da7480bb3e0f67c2c8 Mon Sep 17 00:00:00 2001 From: JupiterPi Date: Fri, 27 Dec 2024 16:24:22 +0100 Subject: [PATCH 2/2] fix: lint issues --- lib/sea.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sea.ts b/lib/sea.ts index d4a78993..c637453c 100644 --- a/lib/sea.ts +++ b/lib/sea.ts @@ -417,7 +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); } }