fix: bigint overflow
This commit is contained in:
@@ -17,7 +17,9 @@ var callServiceList = rpc.declare({
|
||||
params: ['name'],
|
||||
expect: { '': {} }
|
||||
});
|
||||
|
||||
function enquoteBigNumber(str) {
|
||||
return str.replace(/("\w+"):\s*(\d+)/g, '$1:"$2"');
|
||||
}
|
||||
function getStatus() {
|
||||
var status = {};
|
||||
return Promise.resolve(callServiceList('tailscale')).then(function (res) {
|
||||
@@ -28,7 +30,7 @@ function getStatus() {
|
||||
}
|
||||
return fs.exec("/usr/sbin/tailscale", ["status", "--json"]);
|
||||
}).then(function(res) {
|
||||
var tailscaleStatus = JSON.parse(res.stdout);
|
||||
var tailscaleStatus = JSON.parse(enquoteBigNumber(res.stdout));
|
||||
if (!tailscaleStatus.AuthURL && tailscaleStatus.BackendState == "NeedsLogin") {
|
||||
fs.exec("/usr/sbin/tailscale", ["login"]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user