homegames-common 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -747,21 +747,31 @@ const getAppDataPath = () => {
|
|
|
747
747
|
return '';
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
+
let _path;
|
|
750
751
|
switch (process.platform) {
|
|
751
752
|
case "darwin": {
|
|
752
|
-
|
|
753
|
+
_path = process.env.HOME ? path.join(process.env.HOME, "Library", "Application Support", "homegames") : __dirname;
|
|
754
|
+
break;
|
|
753
755
|
}
|
|
754
756
|
case "win32": {
|
|
755
|
-
|
|
757
|
+
_path = process.env.APPDATA ? path.join(process.env.APPDATA, "homegames") : __dirname;
|
|
758
|
+
break;
|
|
756
759
|
}
|
|
757
760
|
case "linux": {
|
|
758
|
-
|
|
761
|
+
_path = process.env.HOME ? path.join(process.env.HOME, ".homegames") : __dirname;
|
|
762
|
+
break;
|
|
759
763
|
}
|
|
760
764
|
default: {
|
|
761
765
|
console.log("Unsupported platform!");
|
|
762
766
|
process.exit(1);
|
|
763
767
|
}
|
|
764
768
|
}
|
|
769
|
+
|
|
770
|
+
if (!fs.existsSync(_path)) {
|
|
771
|
+
fs.mkdirSync(_path);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
return _path;
|
|
765
775
|
}
|
|
766
776
|
|
|
767
777
|
module.exports = {
|