Skip to content

Commit

Permalink
Merge pull request #15 from tough-griff/update-deps
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
tough-griff authored Feb 10, 2021
2 parents b0fbdad + 8db261c commit 0ab68e8
Show file tree
Hide file tree
Showing 5 changed files with 3,826 additions and 5,051 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
16 changes: 9 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ program
console.log('Welcome to %s v%s (Node.js %s)', RREPL, VERSION, NODE_VERSION);
console.log(chalk.gray('Type ".help" for more information.'));

if (program.verbose)
console.log(chalk.gray('[DEBUG] Using configuration at %s'), program.config);
const { config, verbose } = program.opts();

if (verbose)
console.log(chalk.gray('[DEBUG] Using configuration at %s'), config);

/** @type {repl.REPLServer | void} */
let replServer;
if (fs.existsSync(program.config)) {
if (fs.existsSync(config)) {
try {
// eslint-disable-next-line global-require, import/no-dynamic-require
const noderc = require(program.config);
const noderc = require(config);
replServer = createReplServer();
if (typeof noderc === 'function') noderc(replServer);
} catch (err) {
Expand All @@ -79,14 +81,14 @@ if (fs.existsSync(program.config)) {

console.error(
chalk.red('An error occurred while loading your configuration at %s'),
program.config,
config,
);
console.error(err);
process.exit(1);
}
} else {
if (program.verbose)
console.log(chalk.gray('[DEBUG] No configuration at %s'), program.config);
if (verbose)
console.log(chalk.gray('[DEBUG] No configuration at %s'), config);

replServer = createReplServer();
}
Expand Down
Loading

0 comments on commit 0ab68e8

Please sign in to comment.