Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/windows #3

Merged
merged 2 commits into from
May 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
make callbacks explicit
jacobheun committed May 21, 2018
commit 4347c3c5c83eb2eafbe3ba3374bf705ffd793ece
6 changes: 4 additions & 2 deletions src/portable.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ module.exports = function lockPortable (name, callback) {
}
cb()
}),
(cb) => fs.open(name, 'w+', cb),
(cb) => fs.open(name, 'w+', (err, fd) => cb(err, fd)),
(fd, cb) => {
fs.write(fd, JSON.stringify({
ownerPID: process.pid
@@ -54,7 +54,9 @@ function processLockfile (name, callback) {
case STATUS.LOCKED:
return callback(new Error(`file ${name} already locked`))
case STATUS.STALE:
return fs.unlink(name, callback)
return fs.unlink(name, (err) => {
callback(err)
})
case STATUS.INVALID:
return callback(new Error(`can't lock file ${name}: has invalid content`))
default: