fix(cli): remove the double period before file extension in new migration files
This commit is contained in:
parent
7d8ac9b185
commit
1940885134
2 changed files with 7 additions and 4 deletions
|
|
@ -34,9 +34,7 @@ export default async function newCommand({ directory, template, plugins = [], ex
|
|||
throw new UnexpectedError(`Failed to read template file: ${templatePath}`, { cause: error });
|
||||
}
|
||||
|
||||
filename = `${getTimestampPrefix()}_${sanitizeMigrationName(name)}.${withLeadingPeriod(
|
||||
extension ?? fileExtension,
|
||||
)}`;
|
||||
filename = `${getTimestampPrefix()}_${sanitizeMigrationName(name)}${withLeadingPeriod(extension ?? fileExtension)}`;
|
||||
}
|
||||
|
||||
let hasGeneratedFile = Boolean(filename && content !== undefined);
|
||||
|
|
@ -56,7 +54,7 @@ export default async function newCommand({ directory, template, plugins = [], ex
|
|||
|
||||
if (extension && !hasGeneratedFile) {
|
||||
content = '';
|
||||
filename = `${getTimestampPrefix()}_${sanitizeMigrationName(name)}.${withLeadingPeriod(extension)}`;
|
||||
filename = `${getTimestampPrefix()}_${sanitizeMigrationName(name)}${withLeadingPeriod(extension)}`;
|
||||
}
|
||||
|
||||
if (!filename || content === undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue