@cenk1cenk2/oclif-common 3.2.1 → 3.3.0
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 +9 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -181,6 +181,7 @@ declare class LockerService<LockFile extends LockableData = LockableData> {
|
|
|
181
181
|
lock<T extends LockableData = LockableData>(...data: LockData<T>[]): Promise<void>;
|
|
182
182
|
unlock(...data: UnlockData[]): Promise<void>;
|
|
183
183
|
read(): Promise<LockFile>;
|
|
184
|
+
tryRead(): Promise<LockFile | undefined>;
|
|
184
185
|
write(data: LockFile): Promise<void>;
|
|
185
186
|
private buildPath;
|
|
186
187
|
private normalizePath;
|
package/dist/index.js
CHANGED
|
@@ -855,6 +855,13 @@ var LockerService = class {
|
|
|
855
855
|
async read() {
|
|
856
856
|
return this.parser.parse(await this.fs.read(this.file));
|
|
857
857
|
}
|
|
858
|
+
async tryRead() {
|
|
859
|
+
try {
|
|
860
|
+
return this.parser.parse(await this.fs.read(this.file));
|
|
861
|
+
} catch {
|
|
862
|
+
this.logger.trace("Can not read file therefore not parsing: %s", this.file);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
858
865
|
async write(data) {
|
|
859
866
|
return this.fs.write(this.file, this.parser.stringify(data));
|
|
860
867
|
}
|
|
@@ -1050,7 +1057,7 @@ var Command = class extends import_core2.Command {
|
|
|
1050
1057
|
}
|
|
1051
1058
|
exit(code) {
|
|
1052
1059
|
this.logger.trace("Exitting with code: %d", code);
|
|
1053
|
-
|
|
1060
|
+
process.exit(code ?? 0);
|
|
1054
1061
|
}
|
|
1055
1062
|
runTasks() {
|
|
1056
1063
|
return this.tasks.runAll();
|
|
@@ -1124,7 +1131,7 @@ var ConfigCommand = class extends Command {
|
|
|
1124
1131
|
message: "Please select what to do with the configuration.",
|
|
1125
1132
|
choices: Object.keys(this.choices)
|
|
1126
1133
|
});
|
|
1127
|
-
return this.choices[response]();
|
|
1134
|
+
return this.choices[response].bind(this)();
|
|
1128
1135
|
}
|
|
1129
1136
|
};
|
|
1130
1137
|
__name(ConfigCommand, "ConfigCommand");
|