Remove build artifacts from tracked files
parent
aeaa8c0b2f
commit
d41d18cd4f
@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var Promise = require("bluebird");
|
||||
|
||||
module.exports = function (app) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
app.on("ready", function () {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
};
|
@ -1,16 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var path = require("path");
|
||||
var fileUrl = require("file-url");
|
||||
|
||||
module.exports = function (viewDirectory, options) {
|
||||
return function (viewPath) {
|
||||
var fullPath = path.join(viewDirectory, viewPath);
|
||||
|
||||
if (options.extension != null) {
|
||||
fullPath += "." + options.extension;
|
||||
}
|
||||
|
||||
return fileUrl(fullPath);
|
||||
};
|
||||
};
|
@ -1,50 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var electron = require("electron");
|
||||
var uuid = require("uuid");
|
||||
|
||||
module.exports = function () {
|
||||
var windows = {};
|
||||
|
||||
function packFunction(func) {
|
||||
return ";" + func.toString() + ";" + func.name + "();";
|
||||
}
|
||||
|
||||
function loadLiveReload() {
|
||||
var scriptTag = document.createElement("script");
|
||||
scriptTag.src = "http://127.0.0.1:35729/livereload.js";
|
||||
document.querySelector("head").appendChild(scriptTag);
|
||||
}
|
||||
|
||||
return {
|
||||
create: function create(options) {
|
||||
var id = uuid.v4();
|
||||
var window = new electron.BrowserWindow(options);
|
||||
|
||||
if (options.url != null) {
|
||||
window.loadURL(options.url);
|
||||
}
|
||||
|
||||
if (options.loadDeveloperTools) {
|
||||
window.webContents.openDevTools();
|
||||
}
|
||||
|
||||
if (options.liveReload) {
|
||||
window.webContents.on("dom-ready", function () {
|
||||
window.webContents.executeJavaScript(packFunction(loadLiveReload));
|
||||
});
|
||||
}
|
||||
|
||||
windows[id] = window;
|
||||
|
||||
window.on("closed", function () {
|
||||
delete windows[id];
|
||||
});
|
||||
|
||||
return window;
|
||||
},
|
||||
get: function get(id) {
|
||||
return windows[id];
|
||||
}
|
||||
};
|
||||
};
|
@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var split = require("split");
|
||||
|
||||
module.exports = function logStream(stream, logger) {
|
||||
stream.pipe(split()).on("data", function (data) {
|
||||
if (data.trim() !== "") {
|
||||
logger(data);
|
||||
}
|
||||
});
|
||||
};
|
@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var chalk = require("chalk");
|
||||
|
||||
module.exports = function (livereload, logger) {
|
||||
var _oldChanged = livereload.changed.bind(livereload);
|
||||
livereload.changed = function (filePath) {
|
||||
logger.log(chalk.magenta(filePath) + " reloaded.");
|
||||
_oldChanged.apply(null, arguments);
|
||||
};
|
||||
};
|
@ -1,30 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var childProcess = require("child_process");
|
||||
var rfr = require("rfr");
|
||||
var logStream = rfr("lib/gulp/log-stream");
|
||||
|
||||
module.exports = function runProcess(path, args) {
|
||||
var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
|
||||
|
||||
if (options.logger != null) {
|
||||
options.logger.info("Starting " + path + "...");
|
||||
}
|
||||
|
||||
var proc = childProcess.spawn(path, args, options);
|
||||
|
||||
if (options.logger != null) {
|
||||
logStream(proc.stdout, options.logger.log);
|
||||
logStream(proc.stderr, options.logger.error);
|
||||
}
|
||||
|
||||
proc.on("error", function (err) {
|
||||
if (options.logger != null) {
|
||||
options.logger.error(err.stack);
|
||||
}
|
||||
});
|
||||
|
||||
proc.on("close", function (code) {
|
||||
options.logger.info("Exited with code " + code.toString() + ": " + path + ".");
|
||||
});
|
||||
};
|
@ -1 +0,0 @@
|
||||
<html><head><meta charset="UTF-8"/><title>Sample application</title></head><body><h1>Sample header 2</h1><p>Some sample content</p></body></html>
|
Loading…
Reference in New Issue