claude-code-wakatime 3.0.3 → 3.0.4

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.js CHANGED
@@ -40987,22 +40987,26 @@ var Options = class {
40987
40987
  this.logFile = path3.join(this.resourcesLocation, "wakatime.log");
40988
40988
  }
40989
40989
  getSetting(section, key, internal) {
40990
- const content = fs3.readFileSync(this.getConfigFile(internal ?? false), "utf-8");
40991
- if (content.trim()) {
40992
- let currentSection = "";
40993
- let lines = content.split("\n");
40994
- for (var i = 0; i < lines.length; i++) {
40995
- let line = lines[i];
40996
- if (this.startsWith(line.trim(), "[") && this.endsWith(line.trim(), "]")) {
40997
- currentSection = line.trim().substring(1, line.trim().length - 1).toLowerCase();
40998
- } else if (currentSection === section) {
40999
- let parts = line.split("=");
41000
- let currentKey = parts[0].trim();
41001
- if (currentKey === key && parts.length > 1) {
41002
- return this.removeNulls(parts[1].trim());
40990
+ try {
40991
+ const content = fs3.readFileSync(this.getConfigFile(internal ?? false), "utf-8");
40992
+ if (content.trim()) {
40993
+ let currentSection = "";
40994
+ let lines = content.split("\n");
40995
+ for (var i = 0; i < lines.length; i++) {
40996
+ let line = lines[i];
40997
+ if (this.startsWith(line.trim(), "[") && this.endsWith(line.trim(), "]")) {
40998
+ currentSection = line.trim().substring(1, line.trim().length - 1).toLowerCase();
40999
+ } else if (currentSection === section) {
41000
+ let parts = line.split("=");
41001
+ let currentKey = parts[0].trim();
41002
+ if (currentKey === key && parts.length > 1) {
41003
+ return this.removeNulls(parts[1].trim());
41004
+ }
41003
41005
  }
41004
41006
  }
41007
+ return void 0;
41005
41008
  }
41009
+ } catch (_) {
41006
41010
  return void 0;
41007
41011
  }
41008
41012
  }
@@ -41123,7 +41127,7 @@ var Options = class {
41123
41127
  };
41124
41128
 
41125
41129
  // src/version.ts
41126
- var VERSION = "3.0.2";
41130
+ var VERSION = "3.0.3";
41127
41131
 
41128
41132
  // src/dependencies.ts
41129
41133
  var import_adm_zip = __toESM(require_adm_zip());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-wakatime",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "WakaTime plugin for Claude Code",
5
5
  "bin": {
6
6
  "claude-code-wakatime": "dist/index.js"
package/src/options.ts CHANGED
@@ -34,26 +34,30 @@ export class Options {
34
34
  }
35
35
 
36
36
  public getSetting(section: string, key: string, internal?: boolean): string | undefined {
37
- const content = fs.readFileSync(this.getConfigFile(internal ?? false), 'utf-8');
38
- if (content.trim()) {
39
- let currentSection = '';
40
- let lines = content.split('\n');
41
- for (var i = 0; i < lines.length; i++) {
42
- let line = lines[i];
43
- if (this.startsWith(line.trim(), '[') && this.endsWith(line.trim(), ']')) {
44
- currentSection = line
45
- .trim()
46
- .substring(1, line.trim().length - 1)
47
- .toLowerCase();
48
- } else if (currentSection === section) {
49
- let parts = line.split('=');
50
- let currentKey = parts[0].trim();
51
- if (currentKey === key && parts.length > 1) {
52
- return this.removeNulls(parts[1].trim());
37
+ try {
38
+ const content = fs.readFileSync(this.getConfigFile(internal ?? false), 'utf-8');
39
+ if (content.trim()) {
40
+ let currentSection = '';
41
+ let lines = content.split('\n');
42
+ for (var i = 0; i < lines.length; i++) {
43
+ let line = lines[i];
44
+ if (this.startsWith(line.trim(), '[') && this.endsWith(line.trim(), ']')) {
45
+ currentSection = line
46
+ .trim()
47
+ .substring(1, line.trim().length - 1)
48
+ .toLowerCase();
49
+ } else if (currentSection === section) {
50
+ let parts = line.split('=');
51
+ let currentKey = parts[0].trim();
52
+ if (currentKey === key && parts.length > 1) {
53
+ return this.removeNulls(parts[1].trim());
54
+ }
53
55
  }
54
56
  }
55
- }
56
57
 
58
+ return undefined;
59
+ }
60
+ } catch (_) {
57
61
  return undefined;
58
62
  }
59
63
  }