diff --git a/.yarn/versions/d497ae00.yml b/.yarn/versions/d497ae00.yml new file mode 100644 index 000000000000..557d13bcc42d --- /dev/null +++ b/.yarn/versions/d497ae00.yml @@ -0,0 +1,26 @@ +releases: + "@yarnpkg/cli": patch + "@yarnpkg/parsers": patch + "@yarnpkg/shell": patch + +declined: + - "@yarnpkg/plugin-compat" + - "@yarnpkg/plugin-constraints" + - "@yarnpkg/plugin-dlx" + - "@yarnpkg/plugin-essentials" + - "@yarnpkg/plugin-init" + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-nm" + - "@yarnpkg/plugin-npm-cli" + - "@yarnpkg/plugin-pack" + - "@yarnpkg/plugin-patch" + - "@yarnpkg/plugin-pnp" + - "@yarnpkg/plugin-pnpm" + - "@yarnpkg/plugin-stage" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/plugin-version" + - "@yarnpkg/plugin-workspace-tools" + - "@yarnpkg/builder" + - "@yarnpkg/core" + - "@yarnpkg/doctor" + - "@yarnpkg/sdks" diff --git a/packages/yarnpkg-parsers/sources/shell.ts b/packages/yarnpkg-parsers/sources/shell.ts index 39122489d395..e9e34120e4db 100644 --- a/packages/yarnpkg-parsers/sources/shell.ts +++ b/packages/yarnpkg-parsers/sources/shell.ts @@ -138,7 +138,7 @@ export function stringifyArgumentSegment(argumentSegment: ArgumentSegment): stri return argumentSegment.pattern; case `shell`: - return doubleQuoteIfRequested(`\${${stringifyShellLine(argumentSegment.shell)}}`, argumentSegment.quoted); + return doubleQuoteIfRequested(`$(${stringifyShellLine(argumentSegment.shell)})`, argumentSegment.quoted); case `variable`: return doubleQuoteIfRequested( diff --git a/packages/yarnpkg-parsers/tests/shell.test.ts b/packages/yarnpkg-parsers/tests/shell.test.ts index 60352cf166bc..e7781834e7c0 100644 --- a/packages/yarnpkg-parsers/tests/shell.test.ts +++ b/packages/yarnpkg-parsers/tests/shell.test.ts @@ -186,6 +186,7 @@ const STRINGIFIER_TESTS: Array<[string, string]> = [ [`echo foo > bar`, `echo foo > bar`], [`echo a$B"c"'d'`, `echo a\${B}cd`], [`echo a$B"c"'d'`, `echo a\${B}cd`], + [`echo $(echo a)`, `echo $(echo a)`], [`echo $(( 1 + 2 * 3 - 4 / 5 ))`, `echo $(( ( 1 + ( 2 * 3 ) ) - ( 4 / 5 ) ))`], [`echo $(( 7 - 2 - 3 * 5 / 6 ))`, `echo $(( ( 7 - 2 ) - ( ( 3 * 5 ) / 6 ) ))`], [`(echo foo && echo bar)`, `(echo foo && echo bar)`],