Remove test/protos symlink, use window.PROTO_ROOT for config

pull/749/head
Scott Nonnenberg 8 years ago
parent f4aa6d93a7
commit 3a3aa3efb6
No known key found for this signature in database
GPG Key ID: A4931C09644C654B

@ -37095,11 +37095,18 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
window.textsecure.protobuf = {}; window.textsecure.protobuf = {};
function loadProtoBufs(filename) { function loadProtoBufs(filename) {
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) { return dcodeIO.ProtoBuf.loadProtoFile({root: window.PROTO_ROOT, file: filename}, function(error, result) {
var protos = result.build('textsecure'); if (error) {
for (var protoName in protos) { throw error;
textsecure.protobuf[protoName] = protos[protoName]; }
} var protos = result.build('textsecure');
if (!protos) {
var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ')';
throw new Error(text);
}
for (var protoName in protos) {
textsecure.protobuf[protoName] = protos[protoName];
}
}); });
}; };

@ -4,14 +4,18 @@
window.textsecure.protobuf = {}; window.textsecure.protobuf = {};
function loadProtoBufs(filename) { function loadProtoBufs(filename) {
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) { return dcodeIO.ProtoBuf.loadProtoFile({root: window.PROTO_ROOT, file: filename}, function(error, result) {
if (error) { if (error) {
throw error; throw error;
} }
var protos = result.build('textsecure'); var protos = result.build('textsecure');
for (var protoName in protos) { if (!protos) {
textsecure.protobuf[protoName] = protos[protoName]; var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ')';
} throw new Error(text);
}
for (var protoName in protos) {
textsecure.protobuf[protoName] = protos[protoName];
}
}); });
}; };

@ -3,6 +3,7 @@
console.log('preload'); console.log('preload');
const electron = require('electron') const electron = require('electron')
window.PROTO_ROOT = 'protos';
window.config = require('url').parse(window.location.toString(), true).query; window.config = require('url').parse(window.location.toString(), true).query;
const ipc = electron.ipcRenderer const ipc = electron.ipcRenderer

@ -3,6 +3,7 @@
*/ */
mocha.setup("bdd"); mocha.setup("bdd");
window.assert = chai.assert; window.assert = chai.assert;
window.PROTO_ROOT = '../protos';
(function() { (function() {
var OriginalReporter = mocha._reporter; var OriginalReporter = mocha._reporter;

@ -1 +0,0 @@
../protos/

@ -12215,6 +12215,7 @@ Library.prototype.test = function(obj, type) {
*/ */
mocha.setup("bdd"); mocha.setup("bdd");
window.assert = chai.assert; window.assert = chai.assert;
window.PROTO_ROOT = '../protos';
(function() { (function() {
var OriginalReporter = mocha._reporter; var OriginalReporter = mocha._reporter;

Loading…
Cancel
Save