Skip to content

Commit

Permalink
fix: inline testnet-default-channel.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 15, 2020
1 parent 6b68e2d commit b4c80b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
14 changes: 13 additions & 1 deletion web3.js/bin/bpf-sdk-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ if [[ -z $installDir ]]; then
installDir="$(cd "$(dirname "$0")"/..; pwd)"
fi

channel=$("$(dirname "$0")"/testnet-default-channel.js)
channel=$(
cd "$(dirname "$0")";
node -p '
let p = [
"../lib/node_modules/@solana/web3.js/package.json",
"../@solana/web3.js/package.json",
"../package.json"
].find(require("fs").existsSync);
if (!p) throw new Error("Unable to locate solana-web3.js directory");
require(p)["testnetDefaultChannel"]
'
)

if [[ -n $2 ]]; then
channel=$2
fi
Expand Down
13 changes: 12 additions & 1 deletion web3.js/bin/localnet.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/usr/bin/env bash
set -e

channel=$("$(dirname "$0")"/testnet-default-channel.js)
channel=$(
cd "$(dirname "$0")";
node -p '
let p = [
"../lib/node_modules/@solana/web3.js/package.json",
"../@solana/web3.js/package.json",
"../package.json"
].find(require("fs").existsSync);
if (!p) throw new Error("Unable to locate solana-web3.js directory");
require(p)["testnetDefaultChannel"]
'
)

usage() {
exitcode=0
Expand Down
10 changes: 0 additions & 10 deletions web3.js/bin/testnet-default-channel.js

This file was deleted.

0 comments on commit b4c80b1

Please sign in to comment.