diff --git a/src/commands/MigrationCreateCommand.ts b/src/commands/MigrationCreateCommand.ts index 9d39b06174..383e30c680 100644 --- a/src/commands/MigrationCreateCommand.ts +++ b/src/commands/MigrationCreateCommand.ts @@ -59,7 +59,7 @@ export class MigrationCreateCommand implements yargs.CommandModule { } catch (err) { } } - const path = process.cwd() + "/" + (directory ? (directory + "/") : "") + filename; + const path = (directory.startsWith("/") ? "" : process.cwd() + "/") + (directory ? (directory + "/") : "") + filename; await CommandUtils.createFile(path, fileContent); console.log(`Migration ${chalk.blue(path)} has been generated successfully.`);