@app.json/cli
Version:
Capture what your app needs to be deployed and run
41 lines (40 loc) • 1.6 kB
JavaScript
;
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var cloudformation_1 = require("@app.json/cloudformation");
var core_1 = require("@app.json/core");
var yargs = __importStar(require("yargs"));
var export_dotenv_1 = require("./commands/export-dotenv");
var export_ts_1 = require("./commands/export-ts");
yargs
.scriptName('@app.json/cli')
.usage('$0 <cmd> [args]')
.command('init', 'Create an empty app.json file', function (args) {
return args.option('path', { required: true, string: true });
}, function (argv) {
core_1.init(argv.path);
})
.command('dotenv', 'Export a dotenv file based on an app.json', function (args) {
return args.option('path', { required: true, string: true });
}, function (argv) {
export_dotenv_1.exportDotenv(argv.path);
})
.command('generate', 'Generate an app.json based on a cloudformation template', function (args) {
return args.option('template', { required: true, string: true });
}, function (argv) {
cloudformation_1.generateFromCf(argv.template);
})
.command('ts', 'Generate a config.ts based on an app.json file', function (args) {
return args.option('path', { required: true, string: true });
}, function (argv) {
export_ts_1.exportTs(argv.path);
})
.help()
.parse();