Change the config directory to be under ~/.config for Mac and Linux

This commit is contained in:
Mohammad Fares 2023-07-15 20:44:27 +02:00
parent 2533271eca
commit e0b5107233
3 changed files with 3 additions and 5 deletions

View File

@ -243,7 +243,7 @@ terminalizer config
terminalizer init
```
For Linux and MacOS, the created directory is located under the home directory `~/.terminalizer`. For Windows, it is located under the `AppData`.
For Linux and MacOS, the created directory is located under the home directory `~/config/terminalizer`. For Windows, it is located under the `AppData`.
## Recording

View File

@ -32,7 +32,7 @@ function command(argv) {
// Create the global directory
try {
di.fs.mkdirSync(di.utility.getGlobalDirectory());
di.fs.mkdirSync(di.utility.getGlobalDirectory(), { recursive: true });
} catch (error) {

View File

@ -235,14 +235,12 @@ function changeYAMLValue(data, key, value) {
* @return {String}
*/
function getGlobalDirectory() {
// Windows
if (typeof process.env.APPDATA != 'undefined') {
return di.path.join(process.env.APPDATA, 'terminalizer');
}
return di.path.join(process.env.HOME, '.terminalizer');
return di.path.join(process.env.HOME, '.config/terminalizer');
}
/**