kopia lustrzana https://github.com/c9/core
prevent infinite loop after failed rebuild attempt
rodzic
3e29bc2d4e
commit
36795ae03f
|
@ -326,9 +326,17 @@
|
||||||
|
|
||||||
//::dev:{*/
|
//::dev:{*/
|
||||||
function $rebuild() {
|
function $rebuild() {
|
||||||
|
var progressMsg = document.getElementById("progress-msg");
|
||||||
if (!window.rebuildProc) {
|
if (!window.rebuildProc) {
|
||||||
if (document.getElementById("progress-msg"))
|
if (sessionStorage.triedToReload) {
|
||||||
document.getElementById("progress-msg").firstChild.data = "Rebuilding";
|
win.showDevTools();
|
||||||
|
progressMsg.textContent = "there were errors starting application";
|
||||||
|
return
|
||||||
|
}
|
||||||
|
sessionStorage.triedToReload = 1;
|
||||||
|
|
||||||
|
if (progressMsg)
|
||||||
|
progressMsg.firstChild.data = "Rebuilding";
|
||||||
var proc = window.rebuildProc = spawn("bash", ["./scripts/makelocal.sh", "--quick"]);
|
var proc = window.rebuildProc = spawn("bash", ["./scripts/makelocal.sh", "--quick"]);
|
||||||
proc = spawn("bash", ["../scripts/makelocal.sh"], {cwd: server.__dirname});
|
proc = spawn("bash", ["../scripts/makelocal.sh"], {cwd: server.__dirname});
|
||||||
proc.stdout.on("data", function(d) { console.log(d + "") });
|
proc.stdout.on("data", function(d) { console.log(d + "") });
|
||||||
|
|
|
@ -613,12 +613,18 @@ function registerWindow(win, id) {
|
||||||
|
|
||||||
allWindows[id] = win;
|
allWindows[id] = win;
|
||||||
activeWindowId = id;
|
activeWindowId = id;
|
||||||
win.on("close", function() {
|
function mainCloseHandler() {
|
||||||
if (win.listeners("close").length == 1) {
|
if (win.listeners("close").length == 1) {
|
||||||
onClose(id);
|
onClose(id);
|
||||||
win.close(true);
|
win.close(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// make sure only one mainCloseHandler is attached even after calling win.reload()
|
||||||
|
win.listeners("close").forEach(function(f) {
|
||||||
|
if (f.name == "mainCloseHandler")
|
||||||
|
win.removeListener("close", f);
|
||||||
});
|
});
|
||||||
|
win.on("close", mainCloseHandler);
|
||||||
win.on("focus", function() {
|
win.on("focus", function() {
|
||||||
onFocus(id);
|
onFocus(id);
|
||||||
});
|
});
|
||||||
|
|
Ładowanie…
Reference in New Issue