MCPcopy Create free account
hub / github.com/AnYanYi/Linux-app-installer / escapeShellString

Function escapeShellString

src/lib/scripts/shared.ts:12–19  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

10
11// Don't let anyone sneak shell commands through app names :)
12export function escapeShellString(str: string): string {
13 return str
14 .replace(/\\/g, '\\\\') // Escape backslashes first
15 .replace(/"/g, '\\"') // Escape double quotes
16 .replace(/\$/g, '\\$') // Escape dollar signs
17 .replace(/`/g, '\\`') // Escape backticks
18 .replace(/!/g, '\\!'); // Escape history expansion
19}
20
21export function getSelectedPackages(selectedAppIds: Set<string>, distroId: DistroId): PackageInfo[] {
22 return Array.from(selectedAppIds)

Callers 9

generateNixScriptFunction · 0.90
generateDebianScriptFunction · 0.90
generateUbuntuScriptFunction · 0.90
generateArchScriptFunction · 0.90
generateFedoraScriptFunction · 0.90
generateFlatpakScriptFunction · 0.90
generateSnapScriptFunction · 0.90
generateOpenSUSEScriptFunction · 0.90
generateHomebrewScriptFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected