mirror of
https://github.com/status-im/status-dev-cli.git
synced 2025-02-22 08:38:29 +00:00
refresh-dapp command (needed for Embark)
This commit is contained in:
parent
cad1ed3b52
commit
7b51136d8d
12
README.md
12
README.md
@ -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_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.
|
* `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+!***
|
***Requires Status 0.9.4+ & status-dev-cli 2.2.0+!***
|
||||||
|
|
||||||
|
20
index.js
20
index.js
@ -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>")
|
cli.command("switch-node <url>")
|
||||||
.description("Switches the current RPC node")
|
.description("Switches the current RPC node")
|
||||||
.action(function (url) {
|
.action(function (url) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "status-dev-cli",
|
"name": "status-dev-cli",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"description": "CLI for Status",
|
"description": "CLI for Status",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user