"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var child_process_1=require("child_process"),path_1=require("path"),utils_1=require("../../lib/utils");function default_1(e){var r=e.params||{},t=e.options||{},i={getPascalCase:utils_1.getPascalCase,getSeparatorCase:utils_1.getSeparatorCase,name:r.name,serviceName:t.coreServiceName||r.name+(/(-s|S)ervice$/.test(r.name)?"":"-micro-service"),frontendName:t.coreFrontendName||r.name+(/(-f|F)rontend$/.test(r.name)?"":"-frontend"),microFrontendName:t.coreMicroFrontendName||r.name+(/(-f|F)rontend$/.test(r.name)?"":"-micro-frontend"),prefix:t.prefix||"app",microPrefix:t.prefix||"lib"},e=process.cwd(),s=path_1.join(e,utils_1.getSeparatorCase(t.directory||r.name));process.chdir(__dirname),utils_1.src("./**/*",{base:"./files"}).pipe(utils_1.ejs(i)).pipe(utils_1.dest(s,{workspaceRoot:e,log:!0})).subscribe(function(){process.chdir(s);try{child_process_1.execSync((t.packageManager||"npm")+" install",{stdio:"inherit"}),child_process_1.execSync("git init"),child_process_1.execSync("git add ."),child_process_1.execSync('git commit -m "初始化"',{stdio:"inherit"})}catch(e){process.exit()}})}exports.default=default_1;
