Commit d3e485e9 authored by super-lin0's avatar super-lin0

cli init

parent 214a1fb7
{ {
"name": "nemean-cli", "name": "nemean-cli",
"version": "0.0.9", "version": "0.1.3",
"main": "src/index.js", "main": "src/index.js",
"bin": "bin/npmrc.js", "bin": "bin/npmrc.js",
"license": "ISC", "license": "ISC",
......
...@@ -41,8 +41,11 @@ class Factory { ...@@ -41,8 +41,11 @@ class Factory {
} }
}); });
fs.copySync(`${this.CUR_POJ_PATH}.eslintrc.js`, `${PRO_PATH}/.eslintrc.js`); fs.copySync(`${this.CUR_POJ_PATH}.eslintrc.js`, `${PRO_PATH}/.eslintrc.js`);
fs.copySync(
`${this.CUR_POJ_PATH}.gitignore.template`,
`${PRO_PATH}/.gitignore`
);
fs.copySync(`${this.CUR_POJ_PATH}README.md`, `${PRO_PATH}/README.md`); fs.copySync(`${this.CUR_POJ_PATH}README.md`, `${PRO_PATH}/README.md`);
fs.copySync(`${this.CUR_POJ_PATH}.gitignore`, `${PRO_PATH}/.gitignore`);
} }
// 处理依赖 // 处理依赖
...@@ -71,9 +74,7 @@ class Factory { ...@@ -71,9 +74,7 @@ class Factory {
} }
// devDependencies // devDependencies
Factory.log("开始处理devDependencies");
Object.keys(temPackage.devDependencies).forEach(item => { Object.keys(temPackage.devDependencies).forEach(item => {
Factory.log("处理devDependencies:::: ", item);
const libLocalVersion = const libLocalVersion =
curPackage.devDependencies[item] || curPackage.devDependencies[item] ||
(curPackage.dependencies && curPackage.dependencies[item]); (curPackage.dependencies && curPackage.dependencies[item]);
...@@ -93,12 +94,9 @@ class Factory { ...@@ -93,12 +94,9 @@ class Factory {
delete curPackage.dependencies["nemean-cli"]; delete curPackage.dependencies["nemean-cli"];
} }
}); });
Factory.log("结束处理devDependencies");
// dependencies // dependencies
Factory.log("开始处理depenencies");
Object.keys(temPackage.dependencies).forEach(item => { Object.keys(temPackage.dependencies).forEach(item => {
Factory.log("处理dependencies:::: ", item);
const libLocalVersion = const libLocalVersion =
curPackage.dependencies[item] || curPackage.dependencies[item] ||
(curPackage.dependencies && curPackage.dependencies[item]); (curPackage.dependencies && curPackage.dependencies[item]);
...@@ -120,8 +118,6 @@ class Factory { ...@@ -120,8 +118,6 @@ class Factory {
} }
}); });
Factory.log("处理depenencies");
// scripts // scripts
// 暂时不考虑覆盖问题 // 暂时不考虑覆盖问题
curPackage.scripts = temPackage.scripts; curPackage.scripts = temPackage.scripts;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment