添加 -n, --gitname 和 -e, --gitemail 参数
This commit is contained in:
10
deploy.js
10
deploy.js
@@ -29,13 +29,15 @@ try {
|
||||
commander
|
||||
.version('1.0', '-v, --version') // 默认是 -V。如果要 -v,就要加 '-v --version'
|
||||
.option('-t, --type <type>', `Deploy to server type, web or git. Default to ${Config.deploy.type}`)
|
||||
.option('-l, --local <local>', `Local path to copy from. Default to ${Config.deploy.local}`)
|
||||
.option('-H, --host <host>', `Host IP or domain name of the target server. Default to ${Config.deploy.host}`)
|
||||
.option('-P, --port <port>', `Ssh port number of the target server. Default to ${Config.deploy.port}`)
|
||||
.option('-D, --dir <dir>', `Directory to deploy on the target server. Default to ${Config.deploy.dir}`)
|
||||
.option('-d, --dist <dist>', `Folder to deploy on the target server. Default to ${Config.deploy.dist}`)
|
||||
.option('-D, --dir <dir>', `Destination path to deploy on the target server. Default to ${Config.deploy.dir}`)
|
||||
.option('-d, --dist <dist>', `Destination folder to deploy on the target server. Default to ${Config.deploy.dist}`)
|
||||
.option('-r, --repo <repo>', `git repo address. Default to ${Config.deploy.repo}`)
|
||||
.option('-b, --branch <branch', `git repo branch. Default to ${Config.deploy.branch}`)
|
||||
.option('-l, --local <local>', `Local folder to copy from. Default to ${Config.deploy.local}`)
|
||||
.option('-n, --gitname <name>', `git user name. Default to ${Config.deploy.gitname}`)
|
||||
.option('-e, --gitemail <email>', `git user email. Default to ${Config.deploy.gitemail}`)
|
||||
.option('-u, --user <user>', `User id to login the target server. Default to ${Config.deploy.user}`)
|
||||
.option('-k, --key <key>', `User private key file to login the target server. Default to ${Config.deploy.key}`)
|
||||
.option('-p, --password <password>', `User password to login the target server. You may have to enclose it in "". Default to "${Config.deploy.password}"`)
|
||||
@@ -51,6 +53,8 @@ const connection = {
|
||||
dist: commander.dist || Config.deploy.dist || 'dist', // 新系统将发布在这个文件夹里。建议为dist,和npm run build产生的目录一致,这样既可以远程自动部署,也可以直接登录服务器手动部署。
|
||||
repo: commander.repo || Config.deploy.repo,
|
||||
branch: commander.branch || Config.deploy.branch || 'master',
|
||||
gitname: commander.gitname || Config.deploy.gitname,
|
||||
gitemail: commander.gitemail || Config.deploy.gitemail,
|
||||
local: commander.local || Config.deploy.local || './dist',
|
||||
username: commander.user || Config.deploy.user,
|
||||
privateKey: fs.existsSync(privateKeyFile) ? privateKeyFile : undefined,
|
||||
|
||||
Reference in New Issue
Block a user