Skip to content

Commit

Permalink
Merge pull request #579 from salesforcecli/wr/updateFor.js
Browse files Browse the repository at this point in the history
fix: update bin/dev|run exec for when run.js exist
  • Loading branch information
WillieRuemmele authored Oct 30, 2023
2 parents afe6c85 + bf65d37 commit e873274
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/testSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,17 @@ export class TestSession<T extends TestSessionOptions = TestSessionOptions> exte
// TESTKIT_EXECUTABLE_PATH env var is not being used, then set it
// to use the bin/dev from the cwd now.
if (!env.getString('TESTKIT_EXECUTABLE_PATH')) {
const binDev = path.join(process.cwd(), 'bin', 'dev');
env.setString(
'TESTKIT_EXECUTABLE_PATH',
fs.existsSync(binDev) ? binDev : path.join(process.cwd(), 'bin', 'run')
);
let binDev = path.join(process.cwd(), 'bin', 'dev');
if (!fs.existsSync(binDev)) {
binDev += '.js';
}

// only used in the case when bin/dev or bin/dev.js doesn't exist
let binRun = path.join(process.cwd(), 'bin', 'run');
if (!fs.existsSync(binRun)) {
binRun += '.js';
}
env.setString('TESTKIT_EXECUTABLE_PATH', fs.existsSync(binDev) ? binDev : binRun);
}

this.stubCwd(projectDir);
Expand Down

0 comments on commit e873274

Please sign in to comment.