Skip to content

Commit

Permalink
refactor ~ explicitly test for os.homedir/tmpdir as functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Dec 28, 2020
1 parent 8e55fa3 commit 42c3f41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/OSPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ const windows = () => {

const home = () =>
normalize_path(
(os.homedir
(typeof os.homedir === 'function'
? os.homedir()
: env.USERPROFILE || paths.join(env.HOMEDRIVE ?? '', env.HOMEPATH ?? '') || env.HOME) ?? ''
);

const temp = () =>
normalize_path(
(os.tmpdir
(typeof os.tmpdir === 'function'
? os.tmpdir()
: env.TEMP ||
env.TMP ||
Expand Down

0 comments on commit 42c3f41

Please sign in to comment.