Skip to content

Commit

Permalink
feat(agoric-cli): add --no-browser option to open
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Sep 22, 2020
1 parent 44ab432 commit fb8607d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/agoric-cli/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const main = async (progname, rawArgs, powers) => {
'host and port to connect to VM',
'127.0.0.1:8000',
)
.option('--no-browser', `just display the URL, don't open a browser`)
.option(
'--repl [yes | only | no]',
'whether to show the Read-eval-print loop [yes]',
Expand Down
12 changes: 7 additions & 5 deletions packages/agoric-cli/lib/open.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ export default async function walletMain(progname, rawArgs, powers, opts) {
}${suffix}#accessToken=${encodeURIComponent(walletAccessToken)}`;

process.stdout.write(`${walletUrl}\n`);
const browser = opener(walletUrl);
browser.unref();
process.stdout.unref();
process.stderr.unref();
process.stdin.unref();
if (opts.browser) {
const browser = opener(walletUrl);
browser.unref();
process.stdout.unref();
process.stderr.unref();
process.stdin.unref();
}
}

0 comments on commit fb8607d

Please sign in to comment.