UNPKG

@contentstack/cli-cm-seed

Version:

create a Stack from existing content types, entries, assets, etc.

18 lines (17 loc) 779 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.run = void 0; const process = require("process"); const path = require("path"); const cli_cm_import_1 = require("@contentstack/cli-cm-import"); const cli_utilities_1 = require("@contentstack/cli-utilities"); const STACK_FOLDER = 'stack'; async function run(options) { const importPath = (0, cli_utilities_1.pathValidator)(path.resolve((0, cli_utilities_1.sanitizePath)(options.tmpPath), STACK_FOLDER)); const args = options.alias ? ['-k', options.api_key, '-d', importPath, '--alias', options.alias] : ['-k', options.api_key, '-d', importPath]; process.chdir(options.tmpPath); await cli_cm_import_1.default.run(args.concat('--skip-audit')); } exports.run = run;