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

Commit 8235d36

Browse files
committed
fix(app): Change path for run installed @rucke/cli from another application
1 parent 70475e9 commit 8235d36

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/bin/app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,13 @@ 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);
7069
const cwdPackage = fsExtra.readJSONSync(path.resolve(process.cwd() + '/package.json'));
7170
let binPath: string;
7271
if (cwdPackage.name === this.package.name) {
7372
binPath = 'node .';
7473
}
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];
74+
if (fsExtra.existsSync(path.resolve(process.cwd() + '/node_modules/' + this.package.name + '/bin/' + binNames[0]))) {
75+
binPath = 'node ./node_modules/' + this.package.name + '/bin/' + binNames[0];
7776
}
7877
if (!binPath) {
7978
binPath = 'node ' + binNames[0];

0 commit comments

Comments
 (0)