@nextclaw/app-runtime 0.7.6 → 0.7.8
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/package.js
CHANGED
|
@@ -2,6 +2,8 @@ import { resolve } from "node:path";
|
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
//#region src/publish/platform-auth-state.service.ts
|
|
5
|
+
const NEXTCLAW_HOME_ENV_KEY = "NEXTCLAW_HOME";
|
|
6
|
+
const NEXTCLAW_DEFAULT_HOME_DIR = ".nextclaw";
|
|
5
7
|
var PlatformAuthStateService = class {
|
|
6
8
|
readCurrentAuthState = () => {
|
|
7
9
|
const configPath = this.resolveConfigPath();
|
|
@@ -18,8 +20,8 @@ var PlatformAuthStateService = class {
|
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
22
|
resolveConfigPath = () => {
|
|
21
|
-
const nextclawHome = process.env
|
|
22
|
-
return resolve(nextclawHome && nextclawHome.length > 0 ? resolve(nextclawHome) : resolve(homedir(),
|
|
23
|
+
const nextclawHome = process.env[NEXTCLAW_HOME_ENV_KEY]?.trim();
|
|
24
|
+
return resolve(nextclawHome && nextclawHome.length > 0 ? resolve(nextclawHome) : resolve(homedir(), NEXTCLAW_DEFAULT_HOME_DIR), "config.json");
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
//#endregion
|