Skip to content

Commit

Permalink
Windows, ffs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Dec 6, 2023
1 parent acccd24 commit 50c4412
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/config/project/prefs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let { join, parse: parsePath } = require('path')
let { join } = require('path')
let { existsSync, readFileSync } = require('fs')
let read = require('../../../read')
let validate = require('../validate')
Expand All @@ -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(_homedir).root, '')
if (process.platform === 'win32') _homedir = _homedir.replace(/^[A-Z]:\\/, '')
cwd = join(inventory._project.cwd, _homedir)
}

Expand Down
4 changes: 2 additions & 2 deletions test/unit/src/config/project/index-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let { join, parse } = require('path')
let { join } = require('path')
let { homedir } = require('os')
let test = require('tape')
let mockTmp = require('mock-tmp')
Expand All @@ -16,7 +16,7 @@ let _homedir = homedir()
console.log(`_homedir:`, _homedir)
// TODO ↓ remove me! ↓
console.log(`cwd:`, cwd)
if (process.platform === 'win32') _homedir = _homedir.replace(parse(_homedir).root, '')
if (process.platform === 'win32') _homedir = _homedir.replace(/^[A-Z]:\\/, '')
// TODO ↓ remove me! ↓
console.log(`_homedir:`, _homedir)
let globalPrefsFile = join(_homedir, 'prefs.arc')
Expand Down

0 comments on commit 50c4412

Please sign in to comment.