From 475163443ab5b1960ead32467a67fa3d70e4f11b Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Mon, 18 Jun 2018 11:29:20 -0600 Subject: [PATCH] Hopefully this works... --- package-lock.json | 6 ------ package.json | 3 +-- server/helpers/paths.js | 8 ++++++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index c08b7b9c1..a7036a0b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13247,12 +13247,6 @@ } } }, - "platform-folders": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/platform-folders/-/platform-folders-0.2.4.tgz", - "integrity": "sha512-hpUnDjZqntMdwQLQA2F0pIibhONNY8cNrGIMU11gyxuV4GVqnmaFdZ2Oj+iBPHy7phHxkz7OiWcRfT8wXI/DsA==", - "dev": true - }, "please-upgrade-node": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.0.2.tgz", diff --git a/package.json b/package.json index 8c037c94b..3ad54970c 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,9 @@ "jest": "20.0.4", "jest-localstorage-mock": "^2.2.0", "lint-staged": "^7.2.0", - "nodemon": "^1.17.5", "node-sass-chokidar": "1.3.0", + "nodemon": "^1.17.5", "pkg": "^4.3.1", - "platform-folders": "^0.2.4", "plop": "^2.0.0", "prettier": "^1.13.5", "react-dev-utils": "^5.0.1", diff --git a/server/helpers/paths.js b/server/helpers/paths.js index 67004d4d4..bfa205720 100644 --- a/server/helpers/paths.js +++ b/server/helpers/paths.js @@ -1,12 +1,16 @@ -import getPath from "platform-folders"; const AppDirectory = require("appdirectory"); +const fs = require("fs"); const oldpaths = new AppDirectory({ appName: "thorium", appAuthor: "Fyreworks LLC" }); +if (!fs.existsSync(`${require("os").homedir()}/Documents`)) { + fs.mkdirSync(`${require("os").homedir()}/Documents`); +} + const paths = { - userData: `${getPath("documents")}/thorium`, + userData: `${require("os").homedir()}/Documents/thorium`, oldData: oldpaths._userDataTemplate .replace("{0}", "thorium") .replace("/{1}", "")