Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kodi committed Aug 26, 2019
1 parent 439acde commit 06fd773
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions splex.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
const chalk = require('chalk');
const meow = require('meow');
const Tail = require('tail').Tail;
const fs = require('fs');
const fs = require('fs');

const updateNotifier = require('update-notifier');
const pkg = require('./package.json');

// Checks for available update and returns an instance
const notifier = updateNotifier({pkg});

// Notify using the built-in convenience method
notifier.notify();

Expand Down Expand Up @@ -62,25 +62,25 @@ wihout list of files provided
);

// ------------------------------------
let testRcFile = function() {
let testRcFile = function () {
const path = process.cwd() + '/.splexrc.json';
if (fs.existsSync(path)) {
return true;
}

return false;
}
};

let readRcFile = function() {
let readRcFile = function () {
const path = process.cwd() + '/.splexrc.json';
const raw = fs.readFileSync(path);
return JSON.parse(raw);
}

};

let filenames = cli.input;
// Sanity checks
if (cli.input.length === 0) {
if (testRcFile() !== false) {
if (testRcFile() === true) {
console.log(chalk.blueBright('INFO: File names not provided, reading from .splexrc.json file'));
let rcFIle = readRcFile();
filenames = rcFIle.files;
Expand Down Expand Up @@ -204,7 +204,6 @@ let handleChange = function () {
appOptions.term.line = '-'.repeat(process.stdout.columns);
};


// Wait in loop, until someone presses ctrl-c
setInterval(() => {
handleChange();
Expand Down

0 comments on commit 06fd773

Please sign in to comment.