mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
clean up version lookup code (#804)
This commit is contained in:
committed by
GitHub
parent
e94a10023d
commit
76ec9122c0
@@ -9,9 +9,7 @@ import { render } from 'ink';
|
||||
import { App } from './ui/App.js';
|
||||
import { loadCliConfig } from './config/config.js';
|
||||
import { readStdin } from './utils/readStdin.js';
|
||||
import { readPackageUp } from 'read-package-up';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import { getCliVersion } from './utils/version.js';
|
||||
import { sandbox_command, start_sandbox } from './utils/sandbox.js';
|
||||
import { LoadedSettings, loadSettings } from './config/settings.js';
|
||||
import { themeManager } from './ui/themes/theme-manager.js';
|
||||
@@ -34,9 +32,6 @@ import {
|
||||
WriteFileTool,
|
||||
} from '@gemini-code/core';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
export async function main() {
|
||||
// warn about deprecated environment variables
|
||||
if (process.env.GEMINI_CODE_MODEL) {
|
||||
@@ -107,9 +102,7 @@ export async function main() {
|
||||
|
||||
// Render UI, passing necessary config values. Check that there is no command line question.
|
||||
if (process.stdin.isTTY && input?.length === 0) {
|
||||
const readUpResult = await readPackageUp({ cwd: __dirname });
|
||||
const cliVersion =
|
||||
process.env.CLI_VERSION || readUpResult?.packageJson.version || 'unknown';
|
||||
const cliVersion = await getCliVersion();
|
||||
|
||||
render(
|
||||
<React.StrictMode>
|
||||
|
||||
Reference in New Issue
Block a user