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

Commit 2feadd0

Browse files
committed
fix(base): Add run srcgen with @rucken/cli folder for cwd
1 parent 10ee709 commit 2feadd0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class Base {
5252
}
5353
return getLogger({ prefix: this.name + (subName ? (this.name ? '#' : '') + subName : ''), level: 'info' });
5454
}
55-
async commandRunner(commandString: string) {
55+
async commandRunner(commandString: string, cwdDir?: string) {
5656
this.log('commandRunner').debug('start');
5757
this.log('commandRunner').debug('rootFolder', this.rootFolder);
5858
this.log('commandRunner').debug(commandString);
@@ -61,7 +61,7 @@ export class Base {
6161
const child = npmRun.spawnSync(
6262
commandBin,
6363
commandArgs,
64-
{ cwd: process.cwd() }
64+
{ cwd: cwdDir ? cwdDir : process.cwd() }
6565
);
6666
if (child.status === 0 || child.status === '0') {
6767
this.log('commandRunner').debug('status', child.status);
@@ -280,7 +280,7 @@ export class Base {
280280
this.log('po2ts').debug('end');
281281
return await false;
282282
}
283-
let result = await this.commandRunner(commandString);
283+
let result = await this.commandRunner(commandString, path.resolve(__dirname + '/../../'));
284284
if (fsExtra.existsSync(optionsFile)) {
285285
del.sync([optionsFile], { force: true });
286286
}
@@ -345,7 +345,7 @@ export class Base {
345345
this.log('makeTsList').debug('end');
346346
return await false;
347347
}
348-
let result = await this.commandRunner(commandString);
348+
let result = await this.commandRunner(commandString, path.resolve(__dirname + '/../../'));
349349
if (fsExtra.existsSync(optionsFile)) {
350350
del.sync([optionsFile], { force: true });
351351
}

0 commit comments

Comments
 (0)