homegames-common 0.9.9 → 1.0.0
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 +19 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -723,6 +723,23 @@ const log = {
|
|
|
723
723
|
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
+
const getAppDataPath = () => {
|
|
727
|
+
switch (process.platform) {
|
|
728
|
+
case "darwin": {
|
|
729
|
+
return path.join(process.env.HOME, "Library", "Application Support", "homegames");
|
|
730
|
+
}
|
|
731
|
+
case "win32": {
|
|
732
|
+
return path.join(process.env.APPDATA, "homegames");
|
|
733
|
+
}
|
|
734
|
+
case "linux": {
|
|
735
|
+
return path.join(process.env.HOME, ".homegames");
|
|
736
|
+
}
|
|
737
|
+
default: {
|
|
738
|
+
console.log("Unsupported platform!");
|
|
739
|
+
process.exit(1);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
726
743
|
|
|
727
744
|
module.exports = {
|
|
728
745
|
signup,
|
|
@@ -737,6 +754,7 @@ module.exports = {
|
|
|
737
754
|
guaranteeDir,
|
|
738
755
|
getUrl,
|
|
739
756
|
getConfigValue,
|
|
740
|
-
log
|
|
757
|
+
log,
|
|
758
|
+
getAppDataPath
|
|
741
759
|
};
|
|
742
760
|
|