From e0b5107233b56bf8ebfe9757e3f86bee0556b12b Mon Sep 17 00:00:00 2001 From: Mohammad Fares Date: Sat, 15 Jul 2023 20:44:27 +0200 Subject: [PATCH] Change the config directory to be under ~/.config for Mac and Linux --- README.md | 2 +- commands/init.js | 2 +- utility.js | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e5e86f7..4305d15 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/commands/init.js b/commands/init.js index a4a32f7..d497882 100644 --- a/commands/init.js +++ b/commands/init.js @@ -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) { diff --git a/utility.js b/utility.js index 992f294..b5922c2 100644 --- a/utility.js +++ b/utility.js @@ -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'); } /**