refresh-dapp command (needed for Embark)

This commit is contained in:
alwx 2017-03-10 12:16:17 +03:00
parent cad1ed3b52
commit 7b51136d8d
3 changed files with 32 additions and 2 deletions

View File

@ -42,7 +42,17 @@ You can additionally specify `--dapp-port <port>` if your DApp uses port other t
* `dapp_dir` dir that should be observed. Not required;
* `dapp` — JSON containing `whisper-identity` field. It is not required if your DApp contains `package.json` file.
#### 4. Switching network
#### 4. Refreshing a DApp manually
***Requires status-dev-cli 2.2.1+!***
This command simply reloads the DApp
`status-dev-cli refresh-dapp [dapp]`
* `dapp` — JSON containing `whisper-identity` field. It is not required if your DApp contains `package.json` file.
#### 5. Switching network
***Requires Status 0.9.4+ & status-dev-cli 2.2.0+!***

View File

@ -182,6 +182,26 @@ cli.command("watch-dapp [dappDir] [dapp]")
);
});
cli.command("refresh-dapp [dapp]")
.description("Refreshes a debuggable and currently visible DApp")
.action(function (dapp) {
var dappData = getPackageData(dapp);
if (dappData) {
request({
url: "http://" + (cli.ip || defaultIp) + ":5561/dapp-changed",
method: "POST",
json: true,
body: { encoded: dappData }
}, function (error, response, body) {
if (error) {
printMan();
} else {
console.log(chalk.green("DApp has been refreshed succesfully."));
}
});
}
});
cli.command("switch-node <url>")
.description("Switches the current RPC node")
.action(function (url) {

View File

@ -1,6 +1,6 @@
{
"name": "status-dev-cli",
"version": "2.2.0",
"version": "2.2.1",
"description": "CLI for Status",
"main": "index.js",
"bin": {