Skip to content

Commit 90a7765

Browse files
committed
chore: add reset option in local script
1 parent ec6eddb commit 90a7765

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docker-compose/local/lps-local.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ set_defaults() {
77
export LPS_STAGE=regtest
88
}
99

10+
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
11+
echo "Usage: $0 [OPTIONS]"
12+
echo ""
13+
echo "Options:"
14+
echo " -r, --reset Reset the environment by stopping containers and removing volumes"
15+
echo " -h, --help Show this help message and exit"
16+
exit 0
17+
fi
18+
19+
if [[ "$1" == "--reset" || "$1" == "-r" ]]; then
20+
echo "Resetting environment..."
21+
docker compose -p local down
22+
rm -rf volumes
23+
rm -f .env.regtest # delete default
24+
fi
25+
1026
: "${ENV_FILE=".env.regtest"}" ; export ENV_FILE
1127
if [ ! -f "$ENV_FILE" ]; then
1228
echo "Creating $ENV_FILE from sample-config.env..."; cp ../../sample-config.env "$ENV_FILE"

0 commit comments

Comments
 (0)