@cenk1cenk2/oclif-common 3.3.0 → 3.4.1
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/dist/index.d.ts +1 -0
- package/dist/index.js +14 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -178,6 +178,7 @@ declare class LockerService<LockFile extends LockableData = LockableData> {
|
|
|
178
178
|
addUnlock(...data: UnlockData[]): void;
|
|
179
179
|
lockAll(): Promise<void>;
|
|
180
180
|
unlockAll(): Promise<void>;
|
|
181
|
+
all(): Promise<void>;
|
|
181
182
|
lock<T extends LockableData = LockableData>(...data: LockData<T>[]): Promise<void>;
|
|
182
183
|
unlock(...data: UnlockData[]): Promise<void>;
|
|
183
184
|
read(): Promise<LockFile>;
|
package/dist/index.js
CHANGED
|
@@ -280,7 +280,7 @@ var ListrLogger = class extends import_listr22.Logger {
|
|
|
280
280
|
this.logger.warn(message, { status: "skip" });
|
|
281
281
|
}
|
|
282
282
|
success(message) {
|
|
283
|
-
this.logger.info(message, { status: "
|
|
283
|
+
this.logger.info(message, { status: "end" });
|
|
284
284
|
}
|
|
285
285
|
data(message) {
|
|
286
286
|
this.logger.info(message);
|
|
@@ -801,8 +801,12 @@ var LockerService = class {
|
|
|
801
801
|
this.toUnlock = [];
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
+
async all() {
|
|
805
|
+
await this.unlockAll();
|
|
806
|
+
await this.lockAll();
|
|
807
|
+
}
|
|
804
808
|
async lock(...data) {
|
|
805
|
-
let lock = await this.
|
|
809
|
+
let lock = await this.tryRead() ?? {};
|
|
806
810
|
await Promise.all(
|
|
807
811
|
data.map(async (d) => {
|
|
808
812
|
if (d?.enabled === false) {
|
|
@@ -830,7 +834,7 @@ var LockerService = class {
|
|
|
830
834
|
await this.write(lock);
|
|
831
835
|
}
|
|
832
836
|
async unlock(...data) {
|
|
833
|
-
let lock = await this.
|
|
837
|
+
let lock = await this.tryRead();
|
|
834
838
|
if (!lock) {
|
|
835
839
|
this.logger.verbose("Lock file not found. Nothing to unlock.");
|
|
836
840
|
return;
|
|
@@ -859,7 +863,7 @@ var LockerService = class {
|
|
|
859
863
|
try {
|
|
860
864
|
return this.parser.parse(await this.fs.read(this.file));
|
|
861
865
|
} catch {
|
|
862
|
-
this.logger.trace("Can not read
|
|
866
|
+
this.logger.trace("Can not read lockfile: %s", this.file);
|
|
863
867
|
}
|
|
864
868
|
}
|
|
865
869
|
async write(data) {
|
|
@@ -872,7 +876,12 @@ var LockerService = class {
|
|
|
872
876
|
return this.normalizePath(d.path);
|
|
873
877
|
}
|
|
874
878
|
normalizePath(path) {
|
|
875
|
-
|
|
879
|
+
if (Array.isArray(path)) {
|
|
880
|
+
return path;
|
|
881
|
+
} else if (typeof path === "string") {
|
|
882
|
+
return path.split(".");
|
|
883
|
+
}
|
|
884
|
+
return [];
|
|
876
885
|
}
|
|
877
886
|
};
|
|
878
887
|
__name(LockerService, "LockerService");
|