2019-08-26 16:15:41 +00:00
|
|
|
const fs = require('fs-extra')
|
|
|
|
|
|
|
|
const folder = process.argv[2]
|
|
|
|
|
|
|
|
async function execute () {
|
|
|
|
try {
|
2021-09-15 08:36:14 +00:00
|
|
|
await fs.emptyDir('./static')
|
2022-05-03 16:43:21 +00:00
|
|
|
await fs.outputFile('./static/DONT-EDIT-FILES-IN-THIS-DIRECTORY.md', 'For more information see `webui/readme.md`')
|
2019-08-26 16:15:41 +00:00
|
|
|
console.log('Deleted static folder contents!')
|
2021-09-15 08:36:14 +00:00
|
|
|
await fs.copy(`./dist/${folder}`, './static', { overwrite: true })
|
2019-08-26 16:15:41 +00:00
|
|
|
console.log('Installed new files in static folder!')
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
execute()
|