@salesforce/core-bundle 8.8.3 → 8.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -22
- package/package.json +1 -1
package/lib/index.js
CHANGED
@@ -10392,16 +10392,7 @@ var require_fileLocking = __commonJS({
|
|
10392
10392
|
} catch (err) {
|
10393
10393
|
throw sfError_12.SfError.wrap(err);
|
10394
10394
|
}
|
10395
|
-
const
|
10396
|
-
// if the file exists, wait for it to be unlocked
|
10397
|
-
[(0, proper_lockfile_1.lock)(filePath, lockRetryOptions_1.lockRetryOptions)]
|
10398
|
-
) : (
|
10399
|
-
// lock the entire directory to keep others from trying to create the file while we are
|
10400
|
-
[
|
10401
|
-
(0, proper_lockfile_1.lock)((0, node_path_1.dirname)(filePath), lockRetryOptions_1.lockRetryOptions),
|
10402
|
-
(await logger_12.Logger.child("fileLocking.lockInit")).debug(`No file found at ${filePath}. Write will create it. Locking the entire directory until file is written.`)
|
10403
|
-
]
|
10404
|
-
));
|
10395
|
+
const unlock = await (0, proper_lockfile_1.lock)(filePath, { ...lockRetryOptions_1.lockRetryOptions, realpath: false });
|
10405
10396
|
return {
|
10406
10397
|
writeAndUnlock: async (data) => {
|
10407
10398
|
const logger = await logger_12.Logger.child("fileLocking.writeAndUnlock");
|
@@ -10422,16 +10413,7 @@ var require_fileLocking = __commonJS({
|
|
10422
10413
|
} catch (err) {
|
10423
10414
|
throw sfError_12.SfError.wrap(err);
|
10424
10415
|
}
|
10425
|
-
const
|
10426
|
-
// if the file exists, wait for it to be unlocked
|
10427
|
-
[(0, proper_lockfile_1.lockSync)(filePath, lockRetryOptions_1.lockOptions)]
|
10428
|
-
) : (
|
10429
|
-
// lock the entire directory to keep others from trying to create the file while we are
|
10430
|
-
[
|
10431
|
-
(0, proper_lockfile_1.lockSync)((0, node_path_1.dirname)(filePath), lockRetryOptions_1.lockOptions),
|
10432
|
-
logger_12.Logger.childFromRoot("fileLocking.lockInit").debug(`No file found at ${filePath}. Write will create it. Locking the entire directory until file is written.`)
|
10433
|
-
]
|
10434
|
-
);
|
10416
|
+
const unlock = (0, proper_lockfile_1.lockSync)(filePath, { ...lockRetryOptions_1.lockOptions, realpath: false });
|
10435
10417
|
return {
|
10436
10418
|
writeAndUnlock: (data) => {
|
10437
10419
|
const logger = logger_12.Logger.childFromRoot("fileLocking.writeAndUnlock");
|
@@ -12328,7 +12310,7 @@ var require_package2 = __commonJS({
|
|
12328
12310
|
"package.json"(exports2, module2) {
|
12329
12311
|
module2.exports = {
|
12330
12312
|
name: "@salesforce/core-bundle",
|
12331
|
-
version: "8.8.
|
12313
|
+
version: "8.8.5",
|
12332
12314
|
description: "Core libraries to interact with SFDX projects, orgs, and APIs.",
|
12333
12315
|
main: "lib/index",
|
12334
12316
|
types: "lib/index.d.ts",
|
@@ -15945,7 +15927,7 @@ var require_aliasAccessor = __commonJS({
|
|
15945
15927
|
try {
|
15946
15928
|
this.aliasStore = fileContentsRawToAliasStore(await (0, promises_1.readFile)(this.fileLocation, "utf-8"));
|
15947
15929
|
} catch (e) {
|
15948
|
-
if (e instanceof Error && "code" in e && e.code === "ENOENT") {
|
15930
|
+
if (e instanceof Error && "code" in e && typeof e.code === "string" && ["ENOENT", "ENOTDIR"].includes(e.code)) {
|
15949
15931
|
this.aliasStore = /* @__PURE__ */ new Map();
|
15950
15932
|
await (0, promises_1.mkdir)((0, node_path_1.dirname)(this.fileLocation), { recursive: true });
|
15951
15933
|
await this.saveAliasStoreToFile();
|