We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e28c4b commit a41a41aCopy full SHA for a41a41a
rescript
@@ -170,6 +170,9 @@ var maybe_subcommand = process_argv[2];
170
var is_building = false;
171
function releaseBuild() {
172
if (is_building) {
173
+ try {
174
+ fs.unlinkSync(lockFileName);
175
+ } catch (err) {}
176
is_building = false;
177
}
178
@@ -180,8 +183,15 @@ function acquireBuild() {
180
183
181
184
return false;
182
185
} else {
- is_building = true;
- return true;
186
187
+ fs.openSync(lockFileName, "wx", 0o664);
188
+ is_building = true;
189
+ } catch (err) {
190
+ if (err.code === "EEXIST") {
191
+ console.warn(lockFileName, "already exists, try later");
192
+ } else console.log(err);
193
+ }
194
+ return is_building;
195
196
197
0 commit comments