1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/development/run-ganache.sh
Mark Stacey 73e0fdddd0
Use .sh file extension for all Bash scripts (#10499)
The `.sh` file extension is now used for all Bash scripts. This ensures
the files are recognized as Bash scripts by the ShellCheck CI job, and
by editors/IDEs for improved syntax highlighting.
2021-02-23 12:56:41 -03:30

30 lines
653 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -u
set -o pipefail
ganache_cli="$(yarn bin)/ganache-cli"
seed_phrase="${GANACHE_SEED_PHRASE:-phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent}"
_term () {
printf '%s\n' "Received SIGTERM, sending SIGKILL to Ganache"
kill -KILL "$child" 2>/dev/null
exit 42
}
_int () {
printf '%s\n' "Received SIGINT, sending SIGKILL to Ganache"
kill -KILL "$child" 2>/dev/null
exit 42
}
trap _term SIGTERM
trap _int SIGINT
# shellcheck disable=SC2086
$ganache_cli --noVMErrorsOnRPCResponse --networkId 1337 --mnemonic "$seed_phrase" ${GANACHE_ARGS:-} &
child=$!
wait "$child"