@cenk1cenk2/oclif-common 3.2.2 → 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 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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {