Skip to content

Commit 091ec3d

Browse files
authored
restart server script (commontoolsinc#2040)
1 parent 643da05 commit 091ec3d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

scripts/restart-local-dev.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
# Change to repository root (parent of scripts directory)
3+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
cd "$SCRIPT_DIR/.."
5+
6+
# Parse command line arguments
7+
CLEAR_CACHE=false
8+
FORCE=false
9+
while [[ $# -gt 0 ]]; do
10+
case $1 in
11+
--clear-cache)
12+
CLEAR_CACHE=true
13+
shift
14+
;;
15+
--force)
16+
FORCE=true
17+
shift
18+
;;
19+
*)
20+
echo "Unknown option: $1"
21+
echo "Usage: $0 [--clear-cache] [--force]"
22+
exit 1
23+
;;
24+
esac
25+
done
26+
27+
echo "Stopping local dev servers..."
28+
./scripts/stop-local-dev.sh
29+
30+
if [[ "$CLEAR_CACHE" == "true" ]]; then
31+
echo "Clearing cache..."
32+
rm -rf packages/toolshed/cache/*
33+
echo "Cache cleared."
34+
fi
35+
36+
echo "Starting local dev servers..."
37+
if [[ "$FORCE" == "true" ]]; then
38+
./scripts/start-local-dev.sh --force
39+
else
40+
./scripts/start-local-dev.sh
41+
fi

0 commit comments

Comments
 (0)