#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");
var path_1 = require("path");
var meow = require("meow");
var migrator_1 = require("./migrator");
var cli = meow("\n  Usage\n      $ app_migrator <input>\n\n  Options\n    -p, --path        Path to the app to be migrated\n    -r, --replace-v1  Whether or not to replace the v1 app files with the v2 files\n\n  Examples\n    $ app_migrator migrate --path /path/to/my/app/directory/\n", {
    alias: {
        p: "path",
        r: "replace-v1"
    }
});
var cmd = cli.input[0];
if (cmd !== "migrate")
    throw new Error(cmd + " not implemented yet");
cli.flags.path = path_1.resolve(process.cwd(), cli.flags.path);
var stats = fs_1.statSync(cli.flags.path);
if (!stats.isDirectory()) {
    throw new Error("\n    Please provide the path to a v1 app directory\n  ");
}
// Do the migration
migrator_1.default.migrate(cli.flags);
