mirror of
https://github.com/GMGNAI/gmgn-skills.git
synced 2026-08-25 22:18:06 +00:00
fix(config): update dotenv loading order and simplify host assignment
This commit is contained in:
+4
-4
@@ -3,9 +3,9 @@ import { homedir } from "os";
|
|||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
|
|
||||||
// Load global config first (~/.config/gmgn/.env), then project .env (project takes precedence)
|
// Load global config first (~/.config/gmgn/.env, takes precedence), then project .env (supplements only)
|
||||||
loadDotenv({ path: join(homedir(), ".config", "gmgn", ".env") });
|
loadDotenv({ path: join(homedir(), ".config", "gmgn", ".env"), override: true });
|
||||||
loadDotenv({ override: true });
|
loadDotenv();
|
||||||
|
|
||||||
export interface Config {
|
export interface Config {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
@@ -39,7 +39,7 @@ export function getConfig(requirePrivateKey = false): Config {
|
|||||||
die(PRIVATE_KEY_REQUIRED_MSG);
|
die(PRIVATE_KEY_REQUIRED_MSG);
|
||||||
}
|
}
|
||||||
|
|
||||||
const host = process.env.GMGN_HOST ?? "https://openapi.gmgn.ai";
|
const host = "https://openapi.gmgn.ai";
|
||||||
_config = { apiKey: apiKey!, privateKeyPem, host };
|
_config = { apiKey: apiKey!, privateKeyPem, host };
|
||||||
return _config;
|
return _config;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user