Skip to content

Commit

Permalink
Fix Bin, Bump to 1.2.2 (hayesgm#4)
Browse files Browse the repository at this point in the history
This patch makes sure the bin is available generally if you run `npm install -g seacrest` then just being able to run `seacrest`.
  • Loading branch information
hayesgm authored Aug 12, 2022
1 parent 9b69382 commit 4226361
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "seacrest",
"type": "module",
"version": "1.2.0",
"version": "1.2.2",
"description": "WalletConnect over the terminal or GitHub Actions",
"main": "src/index.mjs",
"bin": {
Expand Down
13 changes: 8 additions & 5 deletions src/index.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/sh
":" //# comment; exec /usr/bin/env node --noharmony "$0" "$@"
import { startServer } from "./server.mjs";

const host = process.argv[2] || process.env["ETHEREUM_URL"];
if (!host) {
host = 'https://mainnet.infura.io';
}
let host = process.argv[2] || process.env["ETHEREUM_URL"] || 'https://mainnet.infura.io';
if (!host.startsWith("http")) {
throw new Error(`Expected host to start with http, got: ${host}`);
}
const port = Number(process.argv[3] || process.env["PORT"] || 8585);
const portStr = process.argv[3] || process.env["PORT"] || 8585;
const port = Number(portStr);
if (Number.isNaN(port)) {
throw new Error(`Invalid port ${portStr}`);
}
let connectOpts = {};
if (process.env["LARGE"] === "false") {
connectOpts.large = false;
Expand Down

0 comments on commit 4226361

Please sign in to comment.