mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
Add functionality to check for git extension updates, as well as support for installing a specific ref (#8018)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import { getErrorMessage } from '../../utils/errors.js';
|
||||
interface InstallArgs {
|
||||
source?: string;
|
||||
path?: string;
|
||||
ref?: string;
|
||||
}
|
||||
|
||||
export async function handleInstall(args: InstallArgs) {
|
||||
@@ -31,6 +32,7 @@ export async function handleInstall(args: InstallArgs) {
|
||||
installMetadata = {
|
||||
source,
|
||||
type: 'git',
|
||||
ref: args.ref,
|
||||
};
|
||||
} else {
|
||||
throw new Error(`The source "${source}" is not a valid URL format.`);
|
||||
@@ -66,7 +68,12 @@ export const installCommand: CommandModule = {
|
||||
describe: 'Path to a local extension directory.',
|
||||
type: 'string',
|
||||
})
|
||||
.option('ref', {
|
||||
describe: 'The git ref to install from.',
|
||||
type: 'string',
|
||||
})
|
||||
.conflicts('source', 'path')
|
||||
.conflicts('path', 'ref')
|
||||
.check((argv) => {
|
||||
if (!argv.source && !argv.path) {
|
||||
throw new Error('Either source or --path must be provided.');
|
||||
@@ -77,6 +84,7 @@ export const installCommand: CommandModule = {
|
||||
await handleInstall({
|
||||
source: argv['source'] as string | undefined,
|
||||
path: argv['path'] as string | undefined,
|
||||
ref: argv['ref'] as string | undefined,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user