You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
803 B
27 lines
803 B
1 year ago
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
|
||
|
/**
|
||
|
* 同步 platform-core 定义的前端项目配置
|
||
|
* 从 platform-core 库的 template-project 目录中复制前端项目文件到本地项目
|
||
|
*/
|
||
|
const path =require('path');
|
||
|
const fs =require('fs');
|
||
|
const { cp,parseJson } =require('./util.js');
|
||
|
|
||
|
function updatePackageJson(){
|
||
|
const packageJson =parseJson(process.cwd() + '/package.json');
|
||
|
packageJson.name=path.parse(process.cwd()).base;
|
||
|
packageJson.version='1.0.0';
|
||
|
packageJson.description='';
|
||
|
fs.writeFileSync(process.cwd() + '/package.json', JSON.stringify(packageJson, null, ' '));
|
||
|
}
|
||
|
|
||
|
const create = async () => {
|
||
|
cp(process.cwd() + '/node_modules/platform-core/template-project',process.cwd());
|
||
|
updatePackageJson();
|
||
|
};
|
||
|
|
||
|
module.exports = create;
|