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

Commit

Permalink
better handle of HOME on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-zucker committed Mar 8, 2020
1 parent c262421 commit 8842917
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solid-auth-cli",
"version": "1.0.11",
"version": "1.0.12",
"main": "src/index.js",
"author": "Jeff Zucker",
"license": "MIT",
Expand Down
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ async function currentSession(){
else { return null; }
}
async function getCredentials(fn){
let home = process.env.HOME || ""
fn = fn || path.join( home,".solid-auth-cli-config.json")
fn = fn || path.join( homedir,".solid-auth-cli-config.json")
var creds={};
if(fs.existsSync(fn)) {
try {
Expand All @@ -78,7 +77,7 @@ async function getCredentials(fn){
}

var session;
const homedir = require('os').homedir();
const homedir = require('os').homedir() || "";
const settingsFile = path.join(homedir, '.solid-cli.json');
const identityManager = loadIdentityManager(settingsFile);
const client = new SolidClient({ identityManager });
Expand Down

0 comments on commit 8842917

Please sign in to comment.