Skip to content

Commit

Permalink
open console automatically if there is an error in exrc (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
akahuku committed Jul 8, 2017
1 parent 55c956c commit 3b4d0c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/chrome/frontend/wasavi.js
Expand Up @@ -914,7 +914,7 @@ Collection.prototype = Object.create({}, {
executedRegisterFlags: function () {return executedRegisterFlags},
lastError: [
function () {return lastError},
function (v) {lastError = '' + v}
function (v) {lastError = v}
],

inst: Object.freeze({
Expand Down Expand Up @@ -1391,6 +1391,7 @@ function runExrc () {
.then(() => {
if (exvm.lastError) {
console.log(`wasavi: an error occured in exrc:\n${exvm.lastError}`);
exvm.lastError = undefined;
}

config.saveSnapshot('exrc');
Expand All @@ -1402,7 +1403,13 @@ function runExrc () {
})
.then(() => {
if (exvm.lastError) {
console.log(`wasavi: an error occured in exrc:\n${exvm.lastError}`);
console.log(`wasavi: an error occured while restoring overriden settings:\n${exvm.lastError}`);
exvm.lastError = undefined;
}

if (requestedState.console.open) {
backlog.open();
pushInputMode({}, 'backlog_prompt');
}

exrc = null;
Expand Down

0 comments on commit 3b4d0c8

Please sign in to comment.