From 7ab71084c683b06a3c5d840ec618599d4366a905 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Tue, 29 Sep 2020 13:04:03 -0600 Subject: [PATCH] feat: allow deploy scripts to see the deployment host and port --- packages/agoric-cli/lib/deploy.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/agoric-cli/lib/deploy.js b/packages/agoric-cli/lib/deploy.js index 8771aa4501f..a6a4f5dade4 100644 --- a/packages/agoric-cli/lib/deploy.js +++ b/packages/agoric-cli/lib/deploy.js @@ -71,6 +71,10 @@ export default async function deployMain(progname, rawArgs, powers, opts) { ws.send(body); }; + const match = opts.hostport.match(/^(.*):(\d+)$/); + const host = match ? match[1] : 'localhost'; + const port = match ? match[2] : '8000'; + const wsurl = `ws://${opts.hostport}/private/captp`; const exit = makePromiseKit(); let connected = false; @@ -225,6 +229,8 @@ export { bootPlugin } from ${JSON.stringify(absPath)}; bundleSource: file => bundleSource(pathResolve(file)), pathResolve, installUnsafePlugin, + host, + port, }); } }