Skip to content
This repository was archived by the owner on Jun 28, 2022. It is now read-only.

Commit 8842917

Browse files
committed
better handle of HOME on windows
1 parent c262421 commit 8842917

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solid-auth-cli",
3-
"version": "1.0.11",
3+
"version": "1.0.12",
44
"main": "src/index.js",
55
"author": "Jeff Zucker",
66
"license": "MIT",

src/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ async function currentSession(){
5454
else { return null; }
5555
}
5656
async function getCredentials(fn){
57-
let home = process.env.HOME || ""
58-
fn = fn || path.join( home,".solid-auth-cli-config.json")
57+
fn = fn || path.join( homedir,".solid-auth-cli-config.json")
5958
var creds={};
6059
if(fs.existsSync(fn)) {
6160
try {
@@ -78,7 +77,7 @@ async function getCredentials(fn){
7877
}
7978

8079
var session;
81-
const homedir = require('os').homedir();
80+
const homedir = require('os').homedir() || "";
8281
const settingsFile = path.join(homedir, '.solid-cli.json');
8382
const identityManager = loadIdentityManager(settingsFile);
8483
const client = new SolidClient({ identityManager });

0 commit comments

Comments
 (0)