Skip to content

Commit

Permalink
Merge pull request #205 from leapfrogtechnology/fix/remove-error-log-…
Browse files Browse the repository at this point in the history
…when-dir-does-not-exist

Remove error log when dir does not exist (v2.0.1 Release)
  • Loading branch information
samirsilwal authored Jun 7, 2023
2 parents af33c4c + c0ebfcd commit 265218c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@leapfrogtechnology/sync-db",
"description": "Command line utility to synchronize and version control relational database objects across databases",
"version": "2.0.0",
"version": "2.0.1",
"license": "MIT",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export async function synchronize(
const migrationPath = getMigrationPath(config);
const dirExist = await existsDir(migrationPath);

if (!dirExist) {
log('Migration directory does not exist');
}

const params: SynchronizeParams = {
force: false,
'skip-migration': !dirExist,
Expand Down
4 changes: 3 additions & 1 deletion src/commands/migrate-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class MigrateList extends Command {

// Completed migrations.
for (const item of completedList) {
await printLine(cyan(` • ${item}`));
const completedMigrationName = typeof item === 'string' || item instanceof String ? item : item?.name;

await printLine(cyan(` • ${completedMigrationName}`));
}

// Remaining Migrations
Expand Down
3 changes: 0 additions & 3 deletions src/util/fs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import { log } from './logger';
import { promisify } from 'util';

export const mkdir = promisify(fs.mkdir);
Expand Down Expand Up @@ -66,8 +65,6 @@ export async function existsDir(pathName: string) {

return true;
} catch (err) {
log(err);

return false;
}
}
Expand Down

0 comments on commit 265218c

Please sign in to comment.