# 🚀 Sync Gemini CLI v0.2.1 - Major Feature Update (#483)

This commit is contained in:
tanzhenxin
2025-09-01 14:48:55 +08:00
committed by GitHub
parent 1610c1586e
commit 2572faf726
292 changed files with 19401 additions and 5941 deletions

View File

@@ -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);

View File

@@ -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(),
);