File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11import path from "node:path" ;
2- import { app } from "electron" ;
32
4- import { getResourcesFolderPath } from "../utils" ;
3+ import { getResourcesFolderPath , getWakatimeHome } from "../utils" ;
54import { ConfigFileReader } from "./config-file-reader" ;
65
76export abstract class ConfigFile {
87 static getConfigFilePath ( internalConfig = false ) {
8+ const userHome = getWakatimeHome ( ) ;
99 if ( internalConfig ) {
1010 return path . join ( getResourcesFolderPath ( ) , "wakatime-internal.cfg" ) ;
1111 } else {
12- const userHome = app . getPath ( "home" ) ;
1312 return path . join ( userHome , ".wakatime.cfg" ) ;
1413 }
1514 }
Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ import { execFile } from "node:child_process";
22import fs from "node:fs" ;
33import path from "node:path" ;
44import { app } from "electron" ;
5+ import process from "node:process" ;
56
67import { WAKATIME_PROTOCALL } from "./constants" ;
78
9+ export function getWakatimeHome ( ) : string {
10+ const envHome = process . env [ "WAKATIME_HOME" ] || app . getPath ( "home" ) ;
11+ return envHome . trim ( ) ;
12+ }
13+
814export function getResourcesFolderPath ( ) {
9- const userHome = app . getPath ( "home" ) ;
15+ const userHome = getWakatimeHome ( ) ;
1016
1117 const resourcesFolder = path . join ( userHome , ".wakatime" ) ;
1218
You can’t perform that action at this time.
0 commit comments