Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit c9ec0cb

Browse files
committed
fix(app): Change binPath for run cli from another application
1 parent 14a0693 commit c9ec0cb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/bin/app.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,14 @@ export class App {
6666
.description('run synchronously many different commands with many different options')
6767
.action((listOfCommands: string[]) => {
6868
const binNames = Object.keys(this.package.bin);
69+
const names = Object.keys(this.package.name);
6970
const cwdPackage = fsExtra.readJSONSync(path.resolve(process.cwd() + '/package.json'));
7071
let binPath: string;
7172
if (cwdPackage.name === this.package.name) {
7273
binPath = 'node .';
7374
}
74-
if (fsExtra.existsSync(path.resolve(process.cwd() + '/node_modules/.bin/' + binNames[0]))) {
75-
binPath = './node_modules/.bin/' + binNames[0];
75+
if (fsExtra.existsSync(path.resolve(process.cwd() + '/node_modules/' + names[0] + '/bin/' + binNames[0]))) {
76+
binPath = 'node ./node_modules/' + names[0] + '/bin/' + binNames[0];
7677
}
7778
if (!binPath) {
7879
binPath = 'node ' + binNames[0];

0 commit comments

Comments
 (0)