🎨 improved scripts for updating events and trees
This commit is contained in:
parent
8fbbe4c67b
commit
f0e38035e7
55 changed files with 437 additions and 477 deletions
17
scripts/helpers/save.js
Normal file
17
scripts/helpers/save.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import fs from 'fs'
|
||||
import zipper from 'zip-local'
|
||||
|
||||
export function save(fileName) {
|
||||
try {
|
||||
zipper.sync
|
||||
.zip(`${fileName}`)
|
||||
.compress()
|
||||
.save(`${fileName}.zip`)
|
||||
|
||||
fs.unlinkSync(fileName)
|
||||
return true
|
||||
} catch (err) {
|
||||
console.log('on save error', fileName, err.message)
|
||||
return false
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue