mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
# 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483)
This commit is contained in:
@@ -21,16 +21,24 @@ import { execSync } from 'child_process';
|
||||
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
||||
import { dirname, join, relative } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { readPackageUp } from 'read-package-up';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const root = join(__dirname, '..');
|
||||
const scriptPath = relative(root, fileURLToPath(import.meta.url));
|
||||
const generatedDir = join(root, 'packages/cli/src/generated');
|
||||
const gitCommitFile = join(generatedDir, 'git-commit.ts');
|
||||
const generatedCliDir = join(root, 'packages/cli/src/generated');
|
||||
const cliGitCommitFile = join(generatedCliDir, 'git-commit.ts');
|
||||
const generatedCoreDir = join(root, 'packages/core/src/generated');
|
||||
const coreGitCommitFile = join(generatedCoreDir, 'git-commit.ts');
|
||||
let gitCommitInfo = 'N/A';
|
||||
let cliVersion = 'UNKNOWN';
|
||||
|
||||
if (!existsSync(generatedDir)) {
|
||||
mkdirSync(generatedDir, { recursive: true });
|
||||
if (!existsSync(generatedCliDir)) {
|
||||
mkdirSync(generatedCliDir, { recursive: true });
|
||||
}
|
||||
|
||||
if (!existsSync(generatedCoreDir)) {
|
||||
mkdirSync(generatedCoreDir, { recursive: true });
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -40,6 +48,9 @@ try {
|
||||
if (gitHash) {
|
||||
gitCommitInfo = gitHash;
|
||||
}
|
||||
|
||||
const result = await readPackageUp();
|
||||
cliVersion = result?.packageJson?.version ?? 'UNKNOWN';
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
@@ -53,6 +64,8 @@ const fileContent = `/**
|
||||
// This file is auto-generated by the build script (${scriptPath})
|
||||
// Do not edit this file manually.
|
||||
export const GIT_COMMIT_INFO = '${gitCommitInfo}';
|
||||
export const CLI_VERSION = '${cliVersion}';
|
||||
`;
|
||||
|
||||
writeFileSync(gitCommitFile, fileContent);
|
||||
writeFileSync(cliGitCommitFile, fileContent);
|
||||
writeFileSync(coreGitCommitFile, fileContent);
|
||||
|
||||
@@ -37,7 +37,7 @@ if (!versionType) {
|
||||
run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
|
||||
|
||||
// 3. Get all workspaces and filter out the one we don't want to version.
|
||||
const workspacesToExclude = ['gemini-cli-vscode-ide-companion'];
|
||||
const workspacesToExclude = [];
|
||||
const lsOutput = JSON.parse(
|
||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user