diff --git a/lib/command-parser/expand-arguments.spec.ts b/lib/command-parser/expand-arguments.spec.ts index 4a9b9876..16bad309 100644 --- a/lib/command-parser/expand-arguments.spec.ts +++ b/lib/command-parser/expand-arguments.spec.ts @@ -26,6 +26,15 @@ it('argument placeholder is replaced and quoted properly', () => { expect(parser.parse(commandInfo)).toEqual({ ...commandInfo, command: "echo 'foo bar'" }); }); +it('argument placeholder with single quote and exclamation mark is quoted properly', () => { + const parser = new ExpandArguments(["it's great!"]); + const commandInfo = createCommandInfo('echo {1}'); + expect(parser.parse(commandInfo)).toEqual({ + ...commandInfo, + command: `echo 'it'"'"'s great!'`, + }); +}); + it('multiple single argument placeholders are replaced', () => { const parser = new ExpandArguments(['foo', 'bar']); const commandInfo = createCommandInfo('echo {2} {1}'); diff --git a/package.json b/package.json index 5a8418e9..2906fee9 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "dependencies": { "chalk": "5.6.2", "rxjs": "7.8.2", - "shell-quote": "1.9.0", + "shell-quote": "1.12.0", "supports-color": "10.2.2", "tree-kill": "1.2.2", "yargs": "18.0.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b53f5d6..240d23cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: 7.8.2 version: 7.8.2 shell-quote: - specifier: 1.9.0 - version: 1.9.0 + specifier: 1.12.0 + version: 1.12.0 supports-color: specifier: 10.2.2 version: 10.2.2 @@ -1096,8 +1096,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shell-quote@1.9.0: - resolution: {integrity: sha512-Iov+JwFv/2HcTpcwNMKd8+IWNb8tboQJNQTkAY/LLVK7gGH9jy+LGkVqPxfekHl+yMmiqXszdGWXgkfml7hjqA==} + shell-quote@1.12.0: + resolution: {integrity: sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==} engines: {node: '>= 0.4'} siginfo@2.0.0: @@ -2204,7 +2204,7 @@ snapshots: shebang-regex@3.0.0: {} - shell-quote@1.9.0: {} + shell-quote@1.12.0: {} siginfo@2.0.0: {}