Skip to content

Commit

Permalink
more suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
TalDerei committed Jun 23, 2024
1 parent 8f850b8 commit 3f2925f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions watch-and-repack.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/bin/bash

# Relative paths to the web repositories
PENUMBRA_ZONE_WEB_PATH="../../web"
PRAX_REPO_PATH="."
# Check if `PENUMBRA_ZONE_WEB_PATH` is set and points to a valid directory
if [ -z "$PENUMBRA_ZONE_WEB_PATH" ] || [ ! -d "$PENUMBRA_ZONE_WEB_PATH" ]; then
PENUMBRA_ZONE_WEB_PATH="../../web"
fi

# Repack the packages in penumbra-zone/web
# Check if `PRAX_REPO_PATH` is set and points to a valid directory
if [ -z "$PRAX_REPO_PATH" ] || [ ! -d "$PRAX_REPO_PATH" ]; then
PRAX_REPO_PATH="."
fi

# Repack the packages in `penumbra-zone/web`
repack() {
(cd "$PENUMBRA_ZONE_WEB_PATH" && ./pack-public.sh)
}

# Install dependencies in prax-wallet/web
# Install dependencies in `prax-wallet/web`
install_prax() {
(cd "$PRAX_REPO_PATH" && pnpm add -w ../../web/packages/*/penumbra-zone-*-*.tgz)
(cd "$PRAX_REPO_PATH" && pnpm add -w $PENUMBRA_ZONE_WEB_PATH/packages/*/penumbra-zone-*-*.tgz)
}

# Reload webpack
Expand All @@ -20,7 +26,7 @@ reload_webpack() {
(cd "$PRAX_REPO_PATH" && pnpm run dev &)
}

# Watch for changes in penumbra-zone/web and trigger repack and reload
# Watch for changes in `penumbra-zone/web` and trigger repack and reload
while true; do
fswatch -1 -o "$PENUMBRA_ZONE_WEB_PATH/packages" | while read -r; do
repack
Expand Down

0 comments on commit 3f2925f

Please sign in to comment.