Skip to content

Commit

Permalink
fix(cli-init): config creation and output (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
eseliger committed Dec 3, 2017
1 parent 21c9ecf commit fa2386e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cli.ts
Expand Up @@ -101,7 +101,7 @@ yargs.command(
if (await createMigrationDir(<string>migrationDir)) {
process.stdout.write(`Created ${chalk.cyan(<string>migrationDir)}\n`);
}
createConfig({
await createConfig({
migrationDir: <string>migrationDir,
migrationOutDir: <string>migrationOutDir || './migrations'
});
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Expand Up @@ -171,8 +171,11 @@ export async function isMerkelRepository(): Promise<boolean> {
/**
* Creates the migration directory
*/
export async function createMigrationDir(migrationDir: string) {
await new Promise((resolve, reject) => mkdirp(migrationDir, (err, made) => err ? reject(err) : resolve(made)));
export function createMigrationDir(migrationDir: string): Promise<boolean> {
return new Promise((resolve, reject) => mkdirp(migrationDir, (err, made) =>
/* istanbul ignore next */
err ? reject(err) : resolve(!!made)
));
}

/**
Expand Down

0 comments on commit fa2386e

Please sign in to comment.