feat: add support for 'cu' command in extension installation (#3261)

This commit is contained in:
Rizel Scarlett
2025-07-07 00:31:31 -04:00
committed by GitHub
parent a1f104bc4b
commit 97d96e69d4
3 changed files with 4 additions and 2 deletions
@@ -14,7 +14,7 @@ function getStdioConfig(
timeout: number
) {
// Validate that the command is one of the allowed commands
const allowedCommands = ['docker', 'jbang', 'npx', 'uvx', 'goosed'];
const allowedCommands = ['cu', 'docker', 'jbang', 'npx', 'uvx', 'goosed'];
if (!allowedCommands.includes(cmd)) {
toastService.handleError(
'Invalid Command',
@@ -196,6 +196,7 @@ export function extractExtensionConfig(fixedEntry: FixedExtensionEntry): Extensi
export async function replaceWithShims(cmd: string) {
const binaryPathMap: Record<string, string> = {
cu: await window.electron.getBinaryPath('cu'),
goosed: await window.electron.getBinaryPath('goosed'),
jbang: await window.electron.getBinaryPath('jbang'),
npx: await window.electron.getBinaryPath('npx'),
@@ -212,7 +213,7 @@ export async function replaceWithShims(cmd: string) {
export function removeShims(cmd: string) {
// Only remove shims if the path matches our known shim patterns
const shimPatterns = [/goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/];
const shimPatterns = [/cu$/, /goosed$/, /docker$/, /jbang$/, /npx$/, /uvx$/];
// Check if the command matches any shim pattern
const isShim = shimPatterns.some((pattern) => pattern.test(cmd));
+1
View File
@@ -270,6 +270,7 @@ export async function loadAndAddStoredExtensions() {
// Update the path to the binary based on the command
export async function replaceWithShims(cmd: string) {
const binaryPathMap: Record<string, string> = {
cu: await window.electron.getBinaryPath('cu'),
goosed: await window.electron.getBinaryPath('goosed'),
jbang: await window.electron.getBinaryPath('jbang'),
npx: await window.electron.getBinaryPath('npx'),