Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix(serve:ui): remove sudo, pass remaining cmdline args to serve (#44)
Browse files Browse the repository at this point in the history
* fix(serve:ui): remove sudo, pass remaining cmdline args to serve

* fix: add cleanup for ERR
  • Loading branch information
rob-solana authored Mar 12, 2019
1 parent 38b0ad7 commit 6a22682
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions bin/blockexplorer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,15 @@ cleanup() {
[[ -z $pid ]] || kill "$pid"
done
}
trap cleanup SIGINT SIGTERM
trap cleanup SIGINT SIGTERM ERR

set -x
redis-cli ping

node build/api/api.js &
api=$!

maybeSudo=
if [[ $(uname) = Linux ]]; then
# Run as root for port 80 access
maybeSudo=sudo
fi
$maybeSudo npm run serve:ui &
npm run serve:ui &
ui=$!

wait "$ui"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"re": "semantic-release --repository-url [email protected]:solana-labs/blockexplorer.git",
"start:api": "set -ex; redis-cli ping; babel-node --presets env api/api.js",
"start:ui": "react-scripts start",
"serve:ui": "serve -l 80 -s build",
"serve:ui": "serve -s build",
"test:ui": "react-scripts test"
},
"files": [
Expand Down

0 comments on commit 6a22682

Please sign in to comment.