Skip to content

Commit

Permalink
fix: cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
giladgd committed Apr 4, 2022
1 parent 0cd600b commit 171c1ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/commands/AddReferencesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export class AddReferencesCommand implements yargs.CommandModule<object, command

cwd = process.cwd();

constructor() {
this.builder = this.builder.bind(this);
this.handler = this.handler.bind(this);
}

builder(args: yargs.Argv) {
return args
.usage(`Usage: $0 ${this.command} --dataSource <path> [options]`)
Expand Down Expand Up @@ -46,8 +51,8 @@ export class AddReferencesCommand implements yargs.CommandModule<object, command
});
}

handler = async (args: commandArgs) => {
const cwd = this.cwd ?? process.cwd();
async handler(args: commandArgs) {
const cwd = this.cwd;
let addedMigrationFiles: string[] = [];
let addedEntityFiles: string[] = [];
let addedSubscriberFiles: string[] = [];
Expand Down

0 comments on commit 171c1ca

Please sign in to comment.