Skip to content
Snippets Groups Projects
Commit 597793b6 authored by michael.minelli's avatar michael.minelli
Browse files

Config file => Replace the folder env attribute by the right path in function of the OS

parent 7b6ab542
No related branches found
No related tags found
No related merge requests found
Pipeline #25055 passed
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"name": "dojo_cli", "name": "dojo_cli",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"appdata-path": "^1.0.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"commander": "^10.0.1", "commander": "^10.0.1",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
...@@ -331,6 +332,11 @@ ...@@ -331,6 +332,11 @@
"url": "https://github.com/chalk/ansi-styles?sponsor=1" "url": "https://github.com/chalk/ansi-styles?sponsor=1"
} }
}, },
"node_modules/appdata-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/appdata-path/-/appdata-path-1.0.0.tgz",
"integrity": "sha512-ZbH3ezXfnT/YE3NdqduIt4lBV+H0ybvA2Qx3K76gIjQvh8gROpDFdDLpx6B1QJtW7zxisCbpTlCLhKqoR8cDBw=="
},
"node_modules/arg": { "node_modules/arg": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"test" : "echo \"Error: no test specified\" && exit 1" "test" : "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies" : { "dependencies" : {
"appdata-path": "^1.0.0",
"axios" : "^1.4.0", "axios" : "^1.4.0",
"commander" : "^10.0.1", "commander" : "^10.0.1",
"dotenv" : "^16.0.3", "dotenv" : "^16.0.3",
......
import * as os from 'os';
import HttpManager from '../managers/HttpManager'; import HttpManager from '../managers/HttpManager';
import getAppDataPath from 'appdata-path';
class Config { class Config {
...@@ -15,7 +15,7 @@ class Config { ...@@ -15,7 +15,7 @@ class Config {
this.apiURL = process.env.API_URL || ''; this.apiURL = process.env.API_URL || '';
this.localConfig = { this.localConfig = {
folder: (process.env.LOCAL_CONFIG_FOLDER || '').replace('~', os.homedir()), folder: getAppDataPath('DojoCLI'),
file : process.env.LOCAL_CONFIG_FILE || '' file : process.env.LOCAL_CONFIG_FILE || ''
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment