Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemean-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
superlin
nemean-cli
Commits
a22fb470
Commit
a22fb470
authored
Oct 11, 2019
by
super-lin0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade
parent
d00b2eb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
15 deletions
+13
-15
package.json
package.json
+1
-1
src/index.js
src/index.js
+12
-14
No files found.
package.json
View file @
a22fb470
{
{
"name"
:
"nemean-cli"
,
"name"
:
"nemean-cli"
,
"version"
:
"
1.0.5
"
,
"version"
:
"
0.0.8
"
,
"main"
:
"src/index.js"
,
"main"
:
"src/index.js"
,
"bin"
:
"bin/npmrc.js"
,
"bin"
:
"bin/npmrc.js"
,
"license"
:
"
ISC
"
,
"license"
:
"
ISC
"
,
...
...
src/index.js
View file @
a22fb470
...
@@ -6,7 +6,7 @@ const shell = require("shelljs");
...
@@ -6,7 +6,7 @@ const shell = require("shelljs");
const
PRO_PATH
=
const
PRO_PATH
=
process
.
env
.
INIT_CWD
||
process
.
env
.
npm_rootpath
||
process
.
cwd
();
process
.
env
.
INIT_CWD
||
process
.
env
.
npm_rootpath
||
process
.
cwd
();
const
CUR_PATH
=
`
${
__dirname
}
/..
/
`
;
const
CUR_PATH
=
`
${
__dirname
}
/..`
;
class
Factory
{
class
Factory
{
constructor
(
type
)
{
constructor
(
type
)
{
...
@@ -40,18 +40,9 @@ class Factory {
...
@@ -40,18 +40,9 @@ class Factory {
);
);
}
}
});
});
fs
.
copySync
(
fs
.
copySync
(
`
${
this
.
CUR_POJ_PATH
}
.eslintrc.js`
,
`
${
PRO_PATH
}
/.eslintrc.js`
);
`
${
this
.
CUR_POJ_PATH
}
.eslintrc.js.template`
,
fs
.
copySync
(
`
${
this
.
CUR_POJ_PATH
}
README.md`
,
`
${
PRO_PATH
}
/README.md`
);
`
${
PRO_PATH
}
/.eslintrc.js`
fs
.
copySync
(
`
${
this
.
CUR_POJ_PATH
}
.gitignore`
,
`
${
PRO_PATH
}
/.gitignore`
);
);
fs
.
copySync
(
`
${
this
.
CUR_POJ_PATH
}
README.md.template`
,
`
${
PRO_PATH
}
/README.md`
);
fs
.
copySync
(
`
${
this
.
CUR_POJ_PATH
}
.gitignore.template`
,
`
${
PRO_PATH
}
/.gitignore`
);
}
}
// 处理依赖
// 处理依赖
...
@@ -80,7 +71,9 @@ class Factory {
...
@@ -80,7 +71,9 @@ 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
]);
...
@@ -100,9 +93,12 @@ class Factory {
...
@@ -100,9 +93,12 @@ 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
]);
...
@@ -124,6 +120,8 @@ class Factory {
...
@@ -124,6 +120,8 @@ class Factory {
}
}
});
});
Factory
.
log
(
"
处理depenencies
"
);
// scripts
// scripts
// 暂时不考虑覆盖问题
// 暂时不考虑覆盖问题
curPackage
.
scripts
=
temPackage
.
scripts
;
curPackage
.
scripts
=
temPackage
.
scripts
;
...
@@ -154,7 +152,7 @@ class Factory {
...
@@ -154,7 +152,7 @@ class Factory {
this
.
trimPackage
();
// 处理依赖
this
.
trimPackage
();
// 处理依赖
// this.callBack(); // 执行后续
// this.callBack(); // 执行后续
}
catch
(
e
)
{
}
catch
(
e
)
{
Factory
.
log
(
"
构建失败
"
,
"
red
"
);
Factory
.
log
(
"
构建失败
"
+
e
,
"
red
"
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment