From 88f2444bdd4c7ffed6efab496208ee0942c5d7b5 Mon Sep 17 00:00:00 2001 From: fenduru Date: Tue, 14 Aug 2018 16:30:25 -0400 Subject: [PATCH 1/2] fix(create): invoke correct path when using scoped package When running yarn create, first the package is installed globally, however after installing create was attempting to invoke the binary from within a scope folder that did not exists. The corrects the path resolution to invoke the binary from the actual place it was installed to. fixes #6266 --- src/cli/commands/create.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/create.js b/src/cli/commands/create.js index 01a573bc09..afdb9aecfa 100644 --- a/src/cli/commands/create.js +++ b/src/cli/commands/create.js @@ -56,11 +56,11 @@ export async function run(config: Config, reporter: Reporter, flags: Object, arg throw new MessageError(reporter.lang('invalidPackageName')); } - const {fullName: packageName, scope: packageDir, name: commandName} = coerceCreatePackageName(builderName); + const {fullName: packageName, name: commandName} = coerceCreatePackageName(builderName); await runGlobal(config, reporter, {}, ['add', packageName]); const binFolder = await getBinFolder(config, {}); - const command = path.resolve(binFolder, packageDir, path.basename(commandName)); + const command = path.resolve(binFolder, path.basename(commandName)); await child.spawn(command, rest, {stdio: `inherit`, shell: true}); } From f375880aa4be1662cc7eb90e62f4c1925a735887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Wed, 15 Aug 2018 17:27:22 +0100 Subject: [PATCH 2/2] Update create.js --- src/cli/commands/create.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/create.js b/src/cli/commands/create.js index afdb9aecfa..6f45cb2a38 100644 --- a/src/cli/commands/create.js +++ b/src/cli/commands/create.js @@ -60,7 +60,7 @@ export async function run(config: Config, reporter: Reporter, flags: Object, arg await runGlobal(config, reporter, {}, ['add', packageName]); const binFolder = await getBinFolder(config, {}); - const command = path.resolve(binFolder, path.basename(commandName)); + const command = path.resolve(binFolder, commandName); await child.spawn(command, rest, {stdio: `inherit`, shell: true}); }