|
@@ -48,12 +48,12 @@ function uploadServer() {
|
|
|
const sshCommand = `cd ${filePath} && rm -rf static && unzip -o ${fileName}`;
|
|
|
if (process.platform === 'win32') {
|
|
|
// Windows
|
|
|
- runCommand(`pscp -P ${sshPort} -pw ${password} -hostkey "${hostKey}" ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
|
|
|
- runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw ${password} -hostkey "${hostKey}" -batch "${sshCommand}"`);
|
|
|
+ runCommand(`pscp -P ${sshPort} -pw '${password}' -hostkey "${hostKey}" ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
|
|
|
+ runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw '${password}' -hostkey "${hostKey}" -batch "${sshCommand}"`);
|
|
|
} else {
|
|
|
// Mac/Linux
|
|
|
- runCommand(`sshpass -p "${password}" scp -o StrictHostKeyChecking=no -P ${sshPort} ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
|
|
|
- runCommand(`sshpass -p "${password}" ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
|
|
|
+ runCommand(`sshpass -p '${password}' scp -o StrictHostKeyChecking=no -P ${sshPort} ./zip/${fileName} ${username}@${serverIp}:${filePath}`);
|
|
|
+ runCommand(`sshpass -p '${password}' ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
|
|
|
}
|
|
|
console.log('编译打包后自动部署到服务器上完成');
|
|
|
console.log(`服务器上的地址:${url}`);
|
|
@@ -65,10 +65,10 @@ function delPublic() {
|
|
|
const sshCommand = `cd ${filePath} && rm -rf plugins`;
|
|
|
if (process.platform === 'win32') {
|
|
|
// Windows
|
|
|
- runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw ${password} -hostkey "${hostKey}" -batch "${sshCommand}"`);
|
|
|
+ runCommand(`plink -P ${sshPort} -ssh ${username}@${serverIp} -pw '${password}' -hostkey "${hostKey}" -batch "${sshCommand}"`);
|
|
|
} else {
|
|
|
// Mac/Linux
|
|
|
- runCommand(`sshpass -p "${password}" ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
|
|
|
+ runCommand(`sshpass -p '${password}' ssh -o StrictHostKeyChecking=no -p ${sshPort} ${username}@${serverIp} "${sshCommand}"`);
|
|
|
}
|
|
|
console.log('plugins 等目录移除完成');
|
|
|
}
|