diff options
author | 3top1a <57371001+3top1a@users.noreply.github.com> | 2022-01-24 14:27:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 14:27:29 +0100 |
commit | 18d1166b6b8beef422590607cd02d613dd02d2d0 (patch) | |
tree | 2f97eaeab7935cdd852da46011fdd5a03aa29913 /src/extras/findgame.js | |
parent | 1362df77adf25a941cc31d3a82378f6911728f10 (diff) | |
download | Viper-18d1166b6b8beef422590607cd02d613dd02d2d0.tar.gz Viper-18d1166b6b8beef422590607cd02d613dd02d2d0.zip |
Edge case in vdf reading (#56)
* Edge case
* Alert user only when automatic detection failed
* extra info on not found message
* support for [Free/Open]BSD
Co-authored-by: 0neGal <mail@0negal.com>
Diffstat (limited to 'src/extras/findgame.js')
-rw-r--r-- | src/extras/findgame.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/extras/findgame.js b/src/extras/findgame.js index f7da1c0..42c9b85 100644 --- a/src/extras/findgame.js +++ b/src/extras/findgame.js @@ -41,17 +41,19 @@ module.exports = async () => { } } - let folder = ""; + let folder = null; switch (process.platform) { case "win32": folder = "C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf"; break case "linux": + case "openbsd": + case "freebsd": folder = path.join(app.getPath("home"), "/.steam/steam/steamapps/libraryfolders.vdf"); break } - if (fs.existsSync(folder)) { + if (fs.existsSync(folder) && folder) { let data = fs.readFileSync(folder) let read_vdf = readvdf(data.toString()) if (read_vdf ) {return read_vdf} |