Skip to content

Commit

Permalink
fix(create): invoke correct path when using scoped package (#6271)
Browse files Browse the repository at this point in the history
* 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

* Update create.js
  • Loading branch information
fenduru authored and arcanis committed Aug 16, 2018
1 parent 53a6483 commit 9a62ef5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, commandName);

await child.spawn(command, rest, {stdio: `inherit`, shell: true});
}

0 comments on commit 9a62ef5

Please sign in to comment.