refactor: consolidate container image tag source of truth to cli package.json (#1156)

This commit is contained in:
Brandon Keiji
2025-06-18 12:43:12 -07:00
committed by GitHub
parent c7a422ccdd
commit cc89830b2a
2 changed files with 19 additions and 17 deletions

View File

@@ -85,18 +85,13 @@ export async function loadSandboxConfig(
argv: SandboxCliArgs,
): Promise<SandboxConfig | undefined> {
const sandboxOption = argv.sandbox ?? settings.sandbox;
const sandboxCommand = getSandboxCommand(sandboxOption);
if (!sandboxCommand) {
return undefined;
}
const command = getSandboxCommand(sandboxOption);
const packageJson = await getPackageJson();
return {
command: sandboxCommand,
image:
argv['sandbox-image'] ??
process.env.GEMINI_SANDBOX_IMAGE ??
packageJson?.config?.sandboxImageUri ??
'gemini-cli-sandbox',
};
const image =
argv['sandbox-image'] ??
process.env.GEMINI_SANDBOX_IMAGE ??
packageJson?.config?.sandboxImageUri;
return command && image ? { command, image } : undefined;
}