mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
Fix prefer-string-starts-ends-with lint
This commit is contained in:
parent
0bcb6512b6
commit
d6c52bd5d9
1 changed files with 1 additions and 1 deletions
|
|
@ -370,7 +370,7 @@ function unwrapShellLoginCommand(command: string): string {
|
|||
function unquoteShellCommand(value: string): string {
|
||||
if (value.length < 2) return value;
|
||||
const quote = value[0];
|
||||
if ((quote !== "'" && quote !== '"') || value[value.length - 1] !== quote) return value;
|
||||
if ((quote !== "'" && quote !== '"') || !value.endsWith(quote)) return value;
|
||||
const inner = value.slice(1, -1);
|
||||
return quote === "'" ? inner.replace(/'\\''/g, "'") : inner.replace(/\\(["\\$`])/g, "$1");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue