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:
Jacob MacDonald
2025-09-10 09:35:48 -07:00
committed by GitHub
parent 69b2d77df5
commit ef70c17936
3 changed files with 253 additions and 25 deletions
@@ -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,
});
},
};