fix(config): load dotenv before --check so ~/.config/gmgn/.env is read

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gina888666
2026-06-30 20:12:11 +08:00
parent d56c904b26
commit b782743c8c
+3
View File
@@ -1,3 +1,4 @@
import { config as loadDotenv } from "dotenv";
import { Command } from "commander";
import * as crypto from "crypto";
import * as fs from "fs";
@@ -103,6 +104,8 @@ export function registerConfigCommands(program: Command): void {
const lang = detectLang();
if (opts.check) {
loadDotenv({ path: ENV_FILE, override: true });
loadDotenv();
process.exit(process.env.GMGN_API_KEY ? 0 : 1);
}