@microsoft/node-core-library
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "0.6.1", | ||
"tag": "@microsoft/node-core-library_v0.6.1", | ||
"date": "Sat, 17 Feb 2018 02:53:49 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Fix an issue for LockFiles where not all filesystem operations were wrapped in a try/catch block." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "0.6.0", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/node-core-library_v0.6.0", |
# Change Log - @microsoft/node-core-library | ||
This log was last generated on Fri, 16 Feb 2018 22:05:23 GMT and should not be manually modified. | ||
This log was last generated on Sat, 17 Feb 2018 02:53:49 GMT and should not be manually modified. | ||
## 0.6.1 | ||
Sat, 17 Feb 2018 02:53:49 GMT | ||
### Patches | ||
- Fix an issue for LockFiles where not all filesystem operations were wrapped in a try/catch block. | ||
## 0.6.0 | ||
@@ -6,0 +13,0 @@ Fri, 16 Feb 2018 22:05:23 GMT |
@@ -223,23 +223,23 @@ "use strict"; | ||
let dirtyWhenAcquired = false; | ||
if (fsx.existsSync(lockFilePath)) { | ||
dirtyWhenAcquired = true; | ||
// If the lockfile is held by an process with an exclusive lock, then removing it will | ||
// silently fail. OpenSync() below will then fail and we will be unable to create a lock. | ||
// Otherwise, the lockfile is sitting on disk, but nothing is holding it, implying that | ||
// the last process to hold it died. | ||
fsx.unlinkSync(lockFilePath); | ||
} | ||
let fileDescriptor; | ||
try { | ||
// Attempt to open an exclusive lockfile | ||
fileDescriptor = fsx.openSync(lockFilePath, 'wx'); | ||
} | ||
catch (error) { | ||
// we tried to delete the lock, but something else is holding it, | ||
// (probably an active process), therefore we are unable to create a lock | ||
return undefined; | ||
} | ||
// Ensure we can hand off the file descriptor to the lockfile | ||
let lockFile; | ||
try { | ||
if (fsx.existsSync(lockFilePath)) { | ||
dirtyWhenAcquired = true; | ||
// If the lockfile is held by an process with an exclusive lock, then removing it will | ||
// silently fail. OpenSync() below will then fail and we will be unable to create a lock. | ||
// Otherwise, the lockfile is sitting on disk, but nothing is holding it, implying that | ||
// the last process to hold it died. | ||
fsx.unlinkSync(lockFilePath); | ||
} | ||
try { | ||
// Attempt to open an exclusive lockfile | ||
fileDescriptor = fsx.openSync(lockFilePath, 'wx'); | ||
} | ||
catch (error) { | ||
// we tried to delete the lock, but something else is holding it, | ||
// (probably an active process), therefore we are unable to create a lock | ||
return undefined; | ||
} | ||
// Ensure we can hand off the file descriptor to the lockfile | ||
lockFile = new LockFile(fileDescriptor, lockFilePath, dirtyWhenAcquired); | ||
@@ -246,0 +246,0 @@ fileDescriptor = undefined; |
{ | ||
"name": "@microsoft/node-core-library", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Core libraries that every NodeJS toolchain project should use", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180134
2234