Skip to content

Commit 4cb889b

Browse files
committed
fix acquire & release
1 parent 10b1c13 commit 4cb889b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/rescript_bsb.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ const lockFileName = path.join(cwd, ".bsb.lock");
2727
let ownerProcess = null;
2828
function releaseBuild() {
2929
if (ownerProcess) {
30+
ownerProcess.kill('SIGHUP');
3031
try {
31-
ownerProcess.kill();
32-
fs.unlinkSync(lockFileName);
32+
fs.rmSync(lockFileName);
3333
} catch {}
3434
ownerProcess = null;
3535
}
@@ -53,6 +53,7 @@ function acquireBuild(args, options) {
5353
});
5454
fs.writeFileSync(lockFileName, ownerProcess.pid.toString(), {
5555
encoding: "utf8",
56+
flag: "wx",
5657
mode: 0o664,
5758
});
5859
} catch (err) {

0 commit comments

Comments
 (0)