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
d00b2eb9
Commit
d00b2eb9
authored
Oct 11, 2019
by
super-lin0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli init
parent
b648f8e1
Pipeline
#124
failed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
72 deletions
+3
-72
lib/index.js
lib/index.js
+0
-69
package.json
package.json
+3
-3
No files found.
lib/index.js
deleted
100644 → 0
View file @
b648f8e1
const
program
=
require
(
"
commander
"
);
const
chalk
=
require
(
"
chalk
"
);
const
inquirer
=
require
(
"
inquirer
"
);
program
.
version
(
"
0.0.1
"
)
.
option
(
"
-C, --chdir <path>
"
,
"
change the working directory
"
)
.
option
(
"
-c, --config <path>
"
,
"
set config path. defaults to ./deploy.conf
"
)
.
option
(
"
-T, --no-tests
"
,
"
ignore test hook
"
);
program
.
command
(
"
init
"
)
.
alias
(
"
i
"
)
.
description
(
"
run remote setup commands
"
)
.
action
(
function
()
{
console
.
log
(
chalk
.
red
(
"
开启前端工程化之路
"
));
const
prompts
=
[
{
type
:
"
list
"
,
name
:
"
type
"
,
message
:
"
请选择项目类型:
"
,
pageSize
:
4
,
choices
:
[
{
name
:
"
Web端项目
"
,
value
:
"
web
"
},
{
name
:
"
PC端项目
"
,
value
:
"
pc
"
},
{
name
:
"
Demo项目
"
,
value
:
"
demo
"
},
{
name
:
"
Blank项目
"
,
value
:
"
blank
"
},
{
name
:
"
Test项目
"
,
value
:
"
test
"
},
{
name
:
"
Mobile端项目
"
,
value
:
"
mobile
"
}
]
}
];
inquirer
.
prompt
(
prompts
).
then
(
answers
=>
{
console
.
log
(
"
Hello, world
"
,
answers
);
console
.
log
(
chalk
.
green
(
"
收工咯
"
));
console
.
log
(
chalk
.
blue
(
"
收工咯
"
));
console
.
log
(
chalk
.
blue
.
bgRed
(
"
收工咯
"
));
//支持设置背景
console
.
log
(
chalk
.
blue
(
JSON
.
stringify
(
answers
)));
});
});
// program
// .command("exec <cmd>")
// .description("run the given remote command")
// .action(function(cmd) {
// console.log('exec "%s"', cmd);
// });
// program
// .command("teardown <dir> [otherDirs...]")
// .description("run teardown commands")
// .action(function(dir, otherDirs) {
// console.log('dir "%s"', dir);
// if (otherDirs) {
// otherDirs.forEach(function(oDir) {
// console.log('dir "%s"', oDir);
// });
// }
// });
// program
// .command("*")
// .description("deploy the given env")
// .action(function(env) {
// console.log('deploying "%s"', env);
// });
program
.
parse
(
process
.
argv
);
package.json
View file @
d00b2eb9
{
"name"
:
"nemean-cli"
,
"version"
:
"1.0.
4
"
,
"version"
:
"1.0.
5
"
,
"main"
:
"src/index.js"
,
"bin"
:
"bin/npmrc.js"
,
"license"
:
"
ISC
"
,
"author"
:
"super-lin"
,
"scripts"
:
{
...
...
@@ -13,6 +14,5 @@
"
fs-extra
"
:
"
^8.1.0
"
,
"
inquirer
"
:
"
^7.0.0
"
,
"
shelljs
"
:
"
^0.8.3
"
},
"bin"
:
"bin/npmrc.js"
}
}
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