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

upgrade

parent d00b2eb9
{
"name": "nemean-cli",
"version": "1.0.5",
"version": "0.0.8",
"main": "src/index.js",
"bin": "bin/npmrc.js",
"license": "ISC",
......
......@@ -6,7 +6,7 @@ const shell = require("shelljs");
const PRO_PATH =
process.env.INIT_CWD || process.env.npm_rootpath || process.cwd();
const CUR_PATH = `${__dirname}/../`;
const CUR_PATH = `${__dirname}/..`;
class Factory {
constructor(type) {
......@@ -40,18 +40,9 @@ class Factory {
);
}
});
fs.copySync(
`${this.CUR_POJ_PATH}.eslintrc.js.template`,
`${PRO_PATH}/.eslintrc.js`
);
fs.copySync(
`${this.CUR_POJ_PATH}README.md.template`,
`${PRO_PATH}/README.md`
);
fs.copySync(
`${this.CUR_POJ_PATH}.gitignore.template`,
`${PRO_PATH}/.gitignore`
);
fs.copySync(`${this.CUR_POJ_PATH}.eslintrc.js`, `${PRO_PATH}/.eslintrc.js`);
fs.copySync(`${this.CUR_POJ_PATH}README.md`, `${PRO_PATH}/README.md`);
fs.copySync(`${this.CUR_POJ_PATH}.gitignore`, `${PRO_PATH}/.gitignore`);
}
// 处理依赖
......@@ -80,7 +71,9 @@ class Factory {
}
// devDependencies
Factory.log("开始处理devDependencies");
Object.keys(temPackage.devDependencies).forEach(item => {
Factory.log("处理devDependencies:::: ", item);
const libLocalVersion =
curPackage.devDependencies[item] ||
(curPackage.dependencies && curPackage.dependencies[item]);
......@@ -100,9 +93,12 @@ class Factory {
delete curPackage.dependencies["nemean-cli"];
}
});
Factory.log("结束处理devDependencies");
// dependencies
Factory.log("开始处理depenencies");
Object.keys(temPackage.dependencies).forEach(item => {
Factory.log("处理dependencies:::: ", item);
const libLocalVersion =
curPackage.dependencies[item] ||
(curPackage.dependencies && curPackage.dependencies[item]);
......@@ -124,6 +120,8 @@ class Factory {
}
});
Factory.log("处理depenencies");
// scripts
// 暂时不考虑覆盖问题
curPackage.scripts = temPackage.scripts;
......@@ -154,7 +152,7 @@ class Factory {
this.trimPackage(); // 处理依赖
// this.callBack(); // 执行后续
} catch (e) {
Factory.log("构建失败", "red");
Factory.log("构建失败" + e, "red");
}
}
}
......
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