#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const FS = require("fs");
const PATH = require("path");
const Commander = require("commander");
const index_1 = require("./index");
const pkg = JSON.parse(FS.readFileSync(PATH.join(PATH.resolve(__dirname, '../'), 'package.json')).toString());
Commander.version(`${pkg.version}`);
Commander
    .command('build')
    .description('编译工程')
    .option('-p, --path <v>', '目标工程路径')
    .option('-d, --dist <v>', '编译结果路径')
    .action(cmd => {
    index_1.AntCube.pack.buildProject(cmd.path, cmd.dist).then(value => {
        if (value.success) {
            console.log(`success`);
            process.exit(0);
        }
        else {
            console.log(`${value.message}`);
            process.exit(1);
        }
    }).catch(reason => {
        console.error(`build project failure\n${reason.message}`);
        process.exit(1);
    });
});
Commander.parse(process.argv);
//# sourceMappingURL=cube-cli.js.map