mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 13:22:35 -07:00
Fix: make Dockerfile self-contained with multi-stage build (#24277)
Co-authored-by: David Pierce <davidapierce@google.com>
This commit is contained in:
committed by
GitHub
parent
0d6bd29752
commit
b6fc583b0c
@@ -42,13 +42,19 @@ if (!existsSync(generatedCoreDir)) {
|
||||
}
|
||||
|
||||
try {
|
||||
const gitHash = execSync('git rev-parse --short HEAD', {
|
||||
encoding: 'utf-8',
|
||||
}).trim();
|
||||
if (gitHash) {
|
||||
gitCommitInfo = gitHash;
|
||||
// Check for GIT_COMMIT env var first (e.g. when building inside Docker
|
||||
// without a .git directory available)
|
||||
const envCommit = process.env.GIT_COMMIT;
|
||||
if (envCommit && /^[0-9a-f]+$/i.test(envCommit)) {
|
||||
gitCommitInfo = envCommit;
|
||||
} else {
|
||||
const gitHash = execSync('git rev-parse --short HEAD', {
|
||||
encoding: 'utf-8',
|
||||
}).trim();
|
||||
if (gitHash) {
|
||||
gitCommitInfo = gitHash;
|
||||
}
|
||||
}
|
||||
|
||||
const result = await readPackageUp();
|
||||
cliVersion = result?.packageJson?.version ?? 'UNKNOWN';
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user