1
0
Fork 0
mirror of synced 2024-06-27 18:40:42 +12:00

Add sanity checks to plugin watcher

This commit is contained in:
Andrew Kingston 2022-08-18 12:22:32 +01:00
parent 186f559fb4
commit a32b3705dc

View file

@ -151,6 +151,10 @@ module.exports = server.listen(env.PORT || 0, async () => {
awaitWriteFinish: true,
})
.on("all", async (event: string, path: string) => {
// Sanity checks
if (!path?.endsWith(".tar.gz") || !fs.existsSync(path)) {
return
}
await tenancy.doInTenant(DEFAULT_TENANT_ID, async () => {
try {
const split = path.split("/")