mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-15 12:30:32 -07:00
Add support for auto-updating git extensions (#8511)
This commit is contained in:
@@ -14,6 +14,7 @@ interface InstallArgs {
|
||||
source?: string;
|
||||
path?: string;
|
||||
ref?: string;
|
||||
autoUpdate?: boolean;
|
||||
}
|
||||
|
||||
export async function handleInstall(args: InstallArgs) {
|
||||
@@ -32,6 +33,7 @@ export async function handleInstall(args: InstallArgs) {
|
||||
source,
|
||||
type: 'git',
|
||||
ref: args.ref,
|
||||
autoUpdate: args.autoUpdate,
|
||||
};
|
||||
} else {
|
||||
throw new Error(`The source "${source}" is not a valid URL format.`);
|
||||
@@ -40,6 +42,7 @@ export async function handleInstall(args: InstallArgs) {
|
||||
installMetadata = {
|
||||
source: args.path,
|
||||
type: 'local',
|
||||
autoUpdate: args.autoUpdate,
|
||||
};
|
||||
} else {
|
||||
// This should not be reached due to the yargs check.
|
||||
@@ -71,8 +74,13 @@ export const installCommand: CommandModule = {
|
||||
describe: 'The git ref to install from.',
|
||||
type: 'string',
|
||||
})
|
||||
.option('auto-update', {
|
||||
describe: 'Enable auto-update for this extension.',
|
||||
type: 'boolean',
|
||||
})
|
||||
.conflicts('source', 'path')
|
||||
.conflicts('path', 'ref')
|
||||
.conflicts('path', 'auto-update')
|
||||
.check((argv) => {
|
||||
if (!argv.source && !argv.path) {
|
||||
throw new Error('Either source or --path must be provided.');
|
||||
@@ -84,6 +92,7 @@ export const installCommand: CommandModule = {
|
||||
source: argv['source'] as string | undefined,
|
||||
path: argv['path'] as string | undefined,
|
||||
ref: argv['ref'] as string | undefined,
|
||||
autoUpdate: argv['auto-update'] as boolean | undefined,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user