watch command fix
This commit is contained in:
parent
ea816c30b1
commit
1c0b5618ff
10
cli.js
10
cli.js
|
@ -25,10 +25,6 @@ function fromAscii(str) {
|
||||||
return "0x" + hex;
|
return "0x" + hex;
|
||||||
};
|
};
|
||||||
|
|
||||||
function encodeObject(obj) {
|
|
||||||
return fromAscii(JSON.stringify(obj));
|
|
||||||
}
|
|
||||||
|
|
||||||
function makeSubscription(client, watch, relativePath, contactData) {
|
function makeSubscription(client, watch, relativePath, contactData) {
|
||||||
sub = {
|
sub = {
|
||||||
expression: ["allof", ["match", "*.*"]],
|
expression: ["allof", ["match", "*.*"]],
|
||||||
|
@ -56,13 +52,13 @@ function makeSubscription(client, watch, relativePath, contactData) {
|
||||||
});
|
});
|
||||||
|
|
||||||
url = "http://" + (cli.ip || defaultIp) + ":5561/dapp-changed";
|
url = "http://" + (cli.ip || defaultIp) + ":5561/dapp-changed";
|
||||||
child.execSync("curl -X POST -H \"Content-Type: application/json\" -d '{\"encoded\": \"" + contactData + "\"}' " + url);
|
child.execSync("curl -X POST -H \"Content-Type: application/json\" -d '{\"encoded\": \"" + fromAscii(contactData) + "\"}' " + url);
|
||||||
|
|
||||||
request({
|
request({
|
||||||
url: "http://" + (cli.ip || defaultIp) + ":5561/dapp-changed",
|
url: "http://" + (cli.ip || defaultIp) + ":5561/dapp-changed",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
json: true,
|
json: true,
|
||||||
body: { encoded: contactData }
|
body: { encoded: fromAscii(contactData) }
|
||||||
}, function (error, response, body) {
|
}, function (error, response, body) {
|
||||||
if (error) {
|
if (error) {
|
||||||
printMan();
|
printMan();
|
||||||
|
@ -200,7 +196,7 @@ cli.command("watch [dir] [contact]")
|
||||||
client,
|
client,
|
||||||
resp.watch,
|
resp.watch,
|
||||||
resp.relative_path,
|
resp.relative_path,
|
||||||
encodeObject(contactData)
|
contactData
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "status-dev-cli",
|
"name": "status-dev-cli",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"description": "CLI for Status",
|
"description": "CLI for Status",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
Loading…
Reference in New Issue