We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1977cd commit 23a81caCopy full SHA for 23a81ca
lib/api.js
@@ -5,6 +5,7 @@ var fs = require('fs');
5
var path = require('path');
6
var request = require('request');
7
var crypto = require('crypto');
8
+var os = require('os');
9
10
function TestingBot(options) {
11
this.options = options || {};
@@ -13,7 +14,7 @@ function TestingBot(options) {
13
14
15
if (!this.options.api_key || !this.options.api_secret) {
16
try {
- var tbFile = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.testingbot');
17
+ var tbFile = path.join(os.homedir(), '.testingbot');
18
if (fs.statSync(tbFile).isFile() === true) {
19
var data = fs.readFileSync(tbFile);
20
if (data !== null) {
0 commit comments