Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sumithemmadi authored Nov 24, 2021
1 parent f6e789d commit 977b32c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function generateRandomString(length) {
// User Login
if (argv._.includes("login") && argv._[0] == "login" && argv._.length == 1) {

var dir = process.env.HOME || process.env.HOMEPATH + '/.truecallerjs';
var dir = path.join(process.env.HOME || process.env.HOMEPATH,'/.truecallerjs');

// Check whether '.truecallerjs' folder exist or not.
if (!fs.existsSync(dir)) {
Expand Down Expand Up @@ -337,7 +337,7 @@ if (argv._.includes("login") && argv._[0] == "login" && argv._.length == 1) {
} else if (argv.i && !argv.s) {
let jsonAuthKey = getAuthKey()
if (jsonAuthKey.responseStatus == "error") {
console.log(jsonAuthKey)
console.log(jsonAuthKey.errorResp)
} else {
// let countryCode = jsonAuthKey.phones[0].countryCode;
let installationId = jsonAuthKey.installationId;
Expand All @@ -349,4 +349,4 @@ if (argv._.includes("login") && argv._[0] == "login" && argv._.length == 1) {
}
} else {
yargs.showHelp();
}
}

0 comments on commit 977b32c

Please sign in to comment.