Skip to content

Commit

Permalink
Merge pull request #28 from makerdao/shellcheck
Browse files Browse the repository at this point in the history
Fix shellcheck issues
  • Loading branch information
asymmetric authored Apr 5, 2019
2 parents cd9350e + d9a16f3 commit 8b6af75
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/setup-env.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
CHECK="test \"$_\" != \"$0\""
$CHECK || { echo >&2 "Use this script by sourcing it \`. $0\` instead"; exit 1; }
[[ "$_" != "$0" ]] || { echo >&2 "Use this script by sourcing it \`. $0\` instead"; exit 1; }

find_keyfile() {
local address="$(tr '[:upper:]' '[:lower:]' <<<"${2#0x}")"
local address
address="$(tr '[:upper:]' '[:lower:]' <<<"${2#0x}")"
while IFS= read -r -d '' file; do
if [ "$(jq -r .address "$file")" == "$address" ]; then
echo "$file"
Expand Down Expand Up @@ -42,7 +42,8 @@ export ETH_GAS="${ETH_GAS:-7000000}"
export ETH_FROM="${ETH_FROM:-$(seth ls | head -n1 | awk '{print $1}')}"

# For dai.js tests
export PRIVATE_KEY="$(sethret "$(find_keyfile "$ETH_KEYSTORE" "$ETH_FROM")" "$(cat "$ETH_PASSWORD")")"
PRIVATE_KEY="$(sethret "$(find_keyfile "$ETH_KEYSTORE" "$ETH_FROM")" "$(cat "$ETH_PASSWORD")")"
export PRIVATE_KEY
export JSON_RPC="$ETH_RPC_URL"

echo "=== DAPPTOOLS VARIABLES ==="
Expand Down

0 comments on commit 8b6af75

Please sign in to comment.