From 37ab9424073c37e0c789e6ffe6bb393e19a93c6e Mon Sep 17 00:00:00 2001 From: Terry Date: Mon, 9 Sep 2019 13:15:42 +0800 Subject: [PATCH] fix(nx): remove unused double dashes to avoid yarn's warning --- packages/workspace/src/command-line/affected.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/workspace/src/command-line/affected.ts b/packages/workspace/src/command-line/affected.ts index 4e5a32a0377ec..aaa8bf89be5a9 100644 --- a/packages/workspace/src/command-line/affected.ts +++ b/packages/workspace/src/command-line/affected.ts @@ -216,15 +216,20 @@ async function runCommand( } try { + const isYarn = path + .basename(process.env.npm_execpath || 'npm') + .startsWith('yarn'); await runAll( projects.map(proj => { return commonCommands.includes(targetName) - ? `${cli} -- ${targetName} ${proj} ${transformArgs( + ? `${cli} ${isYarn ? '' : '--'} ${targetName} ${proj} ${transformArgs( args, proj, projectMetadata.get(proj) ).join(' ')} ` - : `${cli} -- run ${proj}:${targetName} ${transformArgs( + : `${cli} ${ + isYarn ? '' : '--' + } run ${proj}:${targetName} ${transformArgs( args, proj, projectMetadata.get(proj)