Skip to content

Commit

Permalink
fix: show executed at as relative
Browse files Browse the repository at this point in the history
  • Loading branch information
theBenForce committed Mar 4, 2020
1 parent 6836b08 commit 59e5d30
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/data-migration-cli/src/commands/list.ts
@@ -1,19 +1,12 @@
import { Command, flags } from "@oclif/command";
import DataMigrationProcessor, {
Configuration,
Driver,
MigrationExecutor,
ScriptContext,
} from "data-migration";
import { appendFileSync } from "fs";
import * as Listr from "listr";
import * as path from "path";

import createLogger, { logFile } from "../utils/createLogger";
import { InitializedMigrationScript } from "data-migration/src/MigrationScript";
import { cli } from "cli-ux";
import loadScripts from "../utils/loadScripts";

import { formatRelative, parseISO } from "date-fns";
import { InitializedMigrationScript } from "data-migration/src/MigrationScript";

export default class List extends Command {
static description = "list all migration scripts and their status";

Expand All @@ -38,8 +31,15 @@ export default class List extends Command {
name: {
header: "Script",
},
executedAt: { header: "Executed At" },
hasRun: { header: "Has Run" },
executedAt: {
header: "Executed At",
get(script: InitializedMigrationScript) {
if (script.executedAt) {
return formatRelative(parseISO(script.executedAt), new Date());
}
},
},
},
flags
);
Expand Down

0 comments on commit 59e5d30

Please sign in to comment.