-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.js
29 lines (24 loc) · 883 Bytes
/
upload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let process = require('child_process')
let clc = require('cli-color');
function system(command) {
return new Promise(function(resolve, reject) {
process.exec(command, function(err, stdout, stderr) {
if (err !== null) {
console.log('exec error: ' + err);
}
resolve();
});
});
}
async function main () {
console.log(clc.red('start update...\nstart building...'));
// await system("yarn build");
console.log(clc.green('build successfully.'))
console.log(clc.red('start zipping...'))
await system('7z a ./yzmall.zip ./dist/*');
console.log(clc.green('zip successfully.'))
console.log(clc.red('start uploading...'))
await system('scp ./yzmall.zip [email protected]:/yt/mgxy-server-kit/apache-tomcat-8.0.24/webapps/yzmall.war')
console.log(clc.green('upload successfully.\nupdate complete!'))
}
main ();