From acccd248e8f137303f8c63d8fe7fe108151c8bde Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Tue, 5 Dec 2023 19:18:13 -0800 Subject: [PATCH] Windows, please, stop --- src/config/project/prefs/index.js | 2 +- test/unit/src/config/project/index-test.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/project/prefs/index.js b/src/config/project/prefs/index.js index 3e827d1..b53040d 100644 --- a/src/config/project/prefs/index.js +++ b/src/config/project/prefs/index.js @@ -14,7 +14,7 @@ module.exports = function getPrefs ({ scope, inventory, errors, _testing }) { /* istanbul ignore next */ if (_testing && scope === 'global') { let _homedir = homedir() - if (process.platform === 'win32') _homedir = _homedir.replace(parsePath(cwd).root, '') + if (process.platform === 'win32') _homedir = _homedir.replace(parsePath(_homedir).root, '') cwd = join(inventory._project.cwd, _homedir) } diff --git a/test/unit/src/config/project/index-test.js b/test/unit/src/config/project/index-test.js index e4f5f13..80831e7 100644 --- a/test/unit/src/config/project/index-test.js +++ b/test/unit/src/config/project/index-test.js @@ -12,7 +12,13 @@ let getProjectConfig = require(sut) let localPrefsFile = 'prefs.arc' let _homedir = homedir() -if (process.platform === 'win32') _homedir = _homedir.replace(parse(cwd).root, '') +// TODO ↓ remove me! ↓ +console.log(`_homedir:`, _homedir) +// TODO ↓ remove me! ↓ +console.log(`cwd:`, cwd) +if (process.platform === 'win32') _homedir = _homedir.replace(parse(_homedir).root, '') +// TODO ↓ remove me! ↓ +console.log(`_homedir:`, _homedir) let globalPrefsFile = join(_homedir, 'prefs.arc') let _testing = true