--local default to './dist'
This commit is contained in:
@@ -51,7 +51,7 @@ 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',
|
||||
local: commander.local || Config.deploy.local || 'dist',
|
||||
local: commander.local || Config.deploy.local || './dist',
|
||||
username: commander.user || Config.deploy.user,
|
||||
privateKey: fs.existsSync(privateKeyFile) ? privateKeyFile : undefined,
|
||||
password: commander.password || Config.deploy.password,
|
||||
@@ -100,7 +100,7 @@ function deployToWeb(){
|
||||
await ssh.execCommand(`mv ${connection.dist} ${connection.dist}-backup-${new Date().toISOString()}`, { cwd: connection.dir })
|
||||
console.log(`[ mkdir ${connection.dist} ... ]`)
|
||||
await ssh.execCommand(`mkdir ${connection.dist}`, { cwd: connection.dir })
|
||||
const toCreate = necessaryPath('./'+connection.local)
|
||||
const toCreate = necessaryPath(path.join('./', connection.local))
|
||||
for (const name of toCreate) {
|
||||
console.log(`[ mkdir ${connection.dist}/${name.join('/')} ... ]`)
|
||||
await ssh.execCommand(`mkdir ${connection.dist}/${name.join('/')}`, { cwd: connection.dir })
|
||||
@@ -108,7 +108,7 @@ function deployToWeb(){
|
||||
|
||||
let err
|
||||
console.log(`[ Upload to ${connection.dir}/${connection.dist} ... ]`)
|
||||
await ssh.putDirectory('./'+connection.local, `${connection.dir}/${connection.dist}`, {
|
||||
await ssh.putDirectory(path.join('./', connection.local), `${connection.dir}/${connection.dist}`, {
|
||||
concurrency: 10,
|
||||
recursive: true,
|
||||
validate: itemPath => {
|
||||
|
||||
Reference in New Issue
Block a user