@@ -67,7 +67,7 @@ async function uploadFile(config: Config) {
6767 } )
6868 console . log ( '登录远程服务器成功' ) ;
6969 // 为避免第一次时报错,尝试建一下文件夹
70- await ssh . execCommand ( `mkdir ${ config . direct } ` )
70+ await ssh . execCommand ( `mkdir ${ config . direct } ` ) . catch ( ( ) => { } )
7171 // 给服务器上的项目做个备份,避免部署失败时,文件丢失
7272 await backupProject ( config )
7373 // 上传网站的发布包至configs中配置的远程服务器的指定地址
@@ -117,10 +117,10 @@ const remoteStart = async (config: Config) => {
117117} ;
118118export default function registerDeployCommand ( cli : CAC ) {
119119 cli . command ( 'deploy <remoteAddr>' , '部署zhin到远程服务器' )
120- . option ( '-u,--uname' , '登录用户名' , { default : 'root' } )
121- . option ( '-p,--upass' , '登录密码,不填则使用秘钥登录' )
122- . option ( '-k,--key' , '登录秘钥文件路径,默认:~/.ssh/{remoteArr}.pem' )
123- . option ( '-d,--direct' , '部署到指定目录,默认:~/{projectName}' )
120+ . option ( '-u,--uname [uname] ' , '登录用户名' , { default : 'root' } )
121+ . option ( '-p,--upass [upass] ' , '登录密码,不填则使用秘钥登录' )
122+ . option ( '-k,--key [key] ' , '登录秘钥文件路径,默认:~/.ssh/{remoteArr}.pem' )
123+ . option ( '-d,--direct [direct] ' , '部署到指定目录,默认:~/{projectName}' )
124124 . action ( async ( remoteArr , options ) => {
125125 await startDeploy ( {
126126 host :remoteArr ,
0 commit comments