Fix config path not correct on all platforms

This commit is contained in:
Alice Gaudon 2020-05-19 10:52:39 +02:00
parent 4724e7d806
commit 645a485daa
3 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,7 @@
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies": { "dependencies": {
"appdata-path": "^1.0.0",
"ejs": "^3.0.1", "ejs": "^3.0.1",
"electron-updater": "^4.2.4", "electron-updater": "^4.2.4",
"esm": "^3.2.25", "esm": "^3.2.25",

View File

@ -1,11 +1,11 @@
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
import {homedir} from "os"; import getAppDataPath from "appdata-path";
import Service from "./Service"; import Service from "./Service";
import Meta from "./Meta"; import Meta from "./Meta";
const configDir = Meta.isDevMode() ? path.resolve(homedir(), '.config/tabs-app-dev') : path.resolve(homedir(), '.config/tabs-app'); const configDir = Meta.isDevMode() ? getAppDataPath('tabs-app-dev') : getAppDataPath('tabs-app');
const configFile = path.resolve(configDir, 'config.json'); const configFile = path.resolve(configDir, 'config.json');
export default class Config { export default class Config {

View File

@ -169,6 +169,11 @@ app-builder-lib@22.6.1:
semver "^7.3.2" semver "^7.3.2"
temp-file "^3.3.7" temp-file "^3.3.7"
appdata-path@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/appdata-path/-/appdata-path-1.0.0.tgz#c4022d0b6727d1ddc1dd7ecec143d4352f3eefad"
integrity sha512-ZbH3ezXfnT/YE3NdqduIt4lBV+H0ybvA2Qx3K76gIjQvh8gROpDFdDLpx6B1QJtW7zxisCbpTlCLhKqoR8cDBw==
argparse@^1.0.7: argparse@^1.0.7:
version "1.0.10" version "1.0.10"
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"