Skip to content

Commit

Permalink
fix: navigate back to previous directory after SEA build (#131)
Browse files Browse the repository at this point in the history
* fix: navigate back to previous directory after SEA build

* fix: lint issues
  • Loading branch information
JupiterPi authored Dec 28, 2024
1 parent 20e8dda commit 1489e94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/sea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 1489e94

Please # to comment.