"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const lib_1 = require("../../lib");
function default_1(_options, _context) {
    return schematics_1.chain([
        (tree, _context) => {
            let project = lib_1.loadProject(tree, _context);
            if (_options.config) {
                project.createFromConfigFile(_options.config);
                project.save();
            }
            else if (_options.configJson) {
                project.setConfig(JSON.parse(_options.configJson));
                project.save();
            }
            else if (_options.tapConfig) {
                project.createTapConfig(_options.tapConfig, _options.appConfig, _options.rebuild);
                project.save();
            }
            // else {
            //   throw new Error('No option given');
            // }
        }
    ]);
}
exports.default = default_1;
//# sourceMappingURL=index.js.map