aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2024-08-05 19:33:38 +0200
committerJan200101 <sentrycraft123@gmail.com>2024-08-05 19:33:38 +0200
commit8fc85282633a622866f3e6e38140084a17dee38f (patch)
tree731113a1c0ec3f3da9992c655521feaa1b2bcba2 /src
parentf59e329533d785695c5286104e01103c942849f8 (diff)
downloadViper-8fc85282633a622866f3e6e38140084a17dee38f.tar.gz
Viper-8fc85282633a622866f3e6e38140084a17dee38f.zip
feat: test gamepath permissions by creating a file
Diffstat (limited to 'src')
-rw-r--r--src/modules/gamepath.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/modules/gamepath.js b/src/modules/gamepath.js
index 5a5f922..0209d1b 100644
--- a/src/modules/gamepath.js
+++ b/src/modules/gamepath.js
@@ -91,6 +91,10 @@ gamepath.has_perms = (folder) => {
fs.constants.R_OK | fs.constants.W_OK
)
+ let test_file_path = path.join(folder || settings().gamepath, ".viper_test");
+ fs.writeFileSync(test_file_path, "");
+ fs.unlinkSync(test_file_path);
+
return true;
} catch (err) {
return false;