summaryrefslogtreecommitdiff
path: root/includes/external/chvfs/index.js
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-03 22:22:48 +0200
committerRaindropsSys <contact@minteck.org>2023-04-03 22:22:48 +0200
commit704e1c22efe6056b0fc2f59b2766f47e1c8d71cc (patch)
tree25c3c3980c115e7bcbc60e62f4b3d3f7fc184c71 /includes/external/chvfs/index.js
parentbbf20f987bb6a7561be3d98518ddaa41b71eaf67 (diff)
downloadpluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.tar.gz
pluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.tar.bz2
pluralconnect-704e1c22efe6056b0fc2f59b2766f47e1c8d71cc.zip
Updated 19 files and added 12 files (automated)
Diffstat (limited to 'includes/external/chvfs/index.js')
-rw-r--r--includes/external/chvfs/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/external/chvfs/index.js b/includes/external/chvfs/index.js
index 0dfd958..fda57bf 100644
--- a/includes/external/chvfs/index.js
+++ b/includes/external/chvfs/index.js
@@ -5,6 +5,7 @@ const watch = require('node-watch');
const child_process = require('child_process');
const fs = require('fs').promises;
const fss = require('fs');
+const path = require('path');
process.on('uncaughtException', (e) => {
console.error(e);
@@ -63,6 +64,7 @@ setInterval(async () => {
await fs.unlink("/opt/peh_save/" + item.file.substring(5));
} else {
console.log("Copying " + item.file);
+ try { await fs.mkdir(path.dirname(item.file), { recursive: true }); } catch (e) {}
await fs.copyFile(item.file, "/opt/peh_save/" + item.file.substring(5));
}
} catch (e) {
@@ -83,6 +85,7 @@ process.on('exit', () => {
fss.unlinkSync("/opt/peh_save/" + item.file.substring(5));
} else {
console.log("Copying " + item.file);
+ try { fss.mkdirSync(path.dirname(item.file), { recursive: true }); } catch (e) {}
fss.copyFileSync(item.file, "/opt/peh_save/" + item.file.substring(5));
}
} catch (e) {