Commit ff8966d2 authored by abbycin's avatar abbycin

fix typo

parent 5cdd0397
...@@ -313,15 +313,18 @@ function build_backend(dst) { ...@@ -313,15 +313,18 @@ function build_backend(dst) {
} }
function build() { function build() {
let dst = 'mo'; let d = new Date();
if(fs.existsSync(dst)) { let base = `mo-${process.platform}-${d.getFullYear()}-${d.getMonth()+1}-${d.getDate()}-${d.getHours()}${d.getMinutes()}${d.getSeconds()}`;
rm(dst); let dir = 'mo';
let dst = path.join(dir, base);
if(fs.existsSync(dir)) {
rm(dir);
} }
fs.mkdirSync(dst); fs.mkdirSync(dst, { recursive: true });
build_frontend(dst); build_frontend(dst);
build_backend(dst); build_backend(dst);
let out = `${dst}.zip`; let out = `${base}.zip`;
if(fs.existsSync(out)) { if(fs.existsSync(out)) {
fs.unlinkSync(out); fs.unlinkSync(out);
} }
...@@ -330,9 +333,12 @@ function build() { ...@@ -330,9 +333,12 @@ function build() {
let archive = archiver('zip', { let archive = archiver('zip', {
zlib: {level: 9} zlib: {level: 9}
}); });
zip.on('close', () => {
rm(dir);
});
archive.pipe(zip); archive.pipe(zip);
archive.on('error', err => { throw err; }); archive.on('error', err => { throw err; });
archive.directory(dst, dst); archive.directory(dst, base);
archive.finalize(); archive.finalize();
} }
......
...@@ -271,7 +271,7 @@ export default { ...@@ -271,7 +271,7 @@ export default {
this.orgData.push(v); this.orgData.push(v);
} }
this.refresh(); this.refresh();
this.$message.info("所更改提交成功"); this.$message.info("所更改提交成功");
}, },
err => { err => {
this.$message.error(`error: ${err}`); this.$message.error(`error: ${err}`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment