Remove test/protos symlink, use window.PROTO_ROOT for config
This commit is contained in:
parent
f4aa6d93a7
commit
3a3aa3efb6
6 changed files with 27 additions and 14 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue