fix: inline testnet-default-channel.js
This commit is contained in:
parent
6b68e2d610
commit
b4c80b1464
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
let p = [
|
||||
__dirname + '/../lib/node_modules/@solana/web3.js/package.json',
|
||||
__dirname + '/../@solana/web3.js/package.json',
|
||||
__dirname + '/../package.json'
|
||||
].find(require('fs').existsSync);
|
||||
if (!p) throw new Error('Unable to locate solana-web3.js directory');
|
||||
|
||||
console.log(require(p)['testnetDefaultChannel']);
|
Loading…
Reference in New Issue