Skip to content
Permalink
Browse files
replace dynamic require with file read
  • Loading branch information
Nicholas Craig committed Feb 15, 2016
1 parent 8072403 commit a74c5b0e17196fcf3866fcbe9073422503bf401b
Showing with 7 additions and 6 deletions.
  1. +7 −6 oak.js
13 oak.js
@@ -14,30 +14,31 @@ function clear()
{
var i,lines;
var stdout = "";

if (windows === false)
{
stdout += "\x1B[2J";
}
else
{
lines = process.stdout.getWindowSize()[1];

for (i=0; i<lines; i++)
{
stdout += "\r\n";
}
}

// Reset cursur
stdout += "\x1B[0f";

process.stdout.write(stdout);
}

function loadConfig(){
try{
config = require(pathToConfig+'config.json');
contents = fs.readFileSync(pathToConfig+'config.json', 'utf8');
config = JSON.parse(contents);
return true;
}
catch(e){
@@ -144,7 +145,7 @@ function particleLogin(){
//prompt for user and password
var userName = readlineSync.questionEMail('Particle Username/Email:');
var password = readlineSync.question('Particle Password:', {
hideEchoBack: true // The typed text on screen is hidden by `*` (default).
hideEchoBack: true // The typed text on screen is hidden by `*` (default).
});
console.log("Logging in to Particle...".green);
spark.login({username: userName.trim(), password: password.trim()},loginCallback);

0 comments on commit a74c5b0

Please sign in to comment.