"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const schematics_1 = require("@angular-devkit/schematics");
const angular_utility_1 = require("../../lib/angular-utility");
const utility_1 = require("../../lib/utility");
function default_1(_options) {
    return (tree, _context) => {
        // if (!shell.hasCommand('firebase')){
        //     // let confirm = await prompt(`It seems you didn't have firebase CLI tool, install il now ? `);
        //     // if (!confirm){
        //     //     throw new SchematicsException('Operation cancelled by user');
        //     // }
        //     await shell.exec('npm install --global firebase-tools');
        //     await shell.exec('firebase login');
        // }
        utility_1.updateJsonFile(tree, 'package.json', (config) => {
            if (!config.scripts) {
                config.scripts = {};
            }
            if (!config.scripts.deploy) {
                config.scripts.deploy = 'ng build --prod &&  firebase deploy';
            }
        });
        let sourceTemplates = schematics_1.url('files');
        return angular_utility_1.applyWithOverwriteRule(sourceTemplates, [
            schematics_1.template({}),
        ], _options.overwrite);
    };
}
exports.default = default_1;
//# sourceMappingURL=index.js.map