Skip to content

Commit

Permalink
fix: logging of seed file name on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Jul 22, 2023
1 parent edc3fcb commit 8bb0ec5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli/commands/seed/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class SeedCreateCommand implements CommandModule {
'.ts';

const nameExtension = getFileNameExtension(sourcePath.name);
const nameWithoutExtension = removeFileNameExtension(sourcePath.name);

let fileName: string;
if (nameExtension) {
Expand All @@ -75,11 +76,11 @@ export class SeedCreateCommand implements CommandModule {
fileName = `${timestamp}-${sourcePath.name}${extension}`;
}
const filePath = sourcePath.directory + path.sep + fileName;
const template = buildSeederFileTemplate(removeFileNameExtension(sourcePath.name), timestamp);
const template = buildSeederFileTemplate(nameWithoutExtension, timestamp);

consola.info(`Seed Directory: ${sourcePath.directory}`);
consola.info(`Seed FileName: ${fileName}`);
consola.info(`Seed Name: ${pascalCase(sourcePath.name)}`);
consola.info(`Seed Name: ${pascalCase(nameWithoutExtension)}`);

try {
await fs.promises.writeFile(filePath, template, { encoding: 'utf-8' });
Expand Down

0 comments on commit 8bb0ec5

Please sign in to comment.