Skip to content

Commit 50f2c50

Browse files
garyshengclaude
andcommitted
feat: add --packs flag for custom pack selection
Users can now install specific packs with --packs=peon,glados,peasant. The pack picker on peonping.com generates this command. Backward compatible: bare curl|bash still installs the 10 defaults. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7758cf3 commit 50f2c50

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ set -euo pipefail
66

77
LOCAL_MODE=false
88
INSTALL_ALL=false
9+
CUSTOM_PACKS=""
910
for arg in "$@"; do
1011
case "$arg" in
1112
--local) LOCAL_MODE=true ;;
1213
--all) INSTALL_ALL=true ;;
14+
--packs=*) CUSTOM_PACKS="${arg#--packs=}" ;;
1315
esac
1416
done
1517

@@ -184,7 +186,10 @@ else
184186
fi
185187

186188
# Select packs to install
187-
if [ "$INSTALL_ALL" = true ]; then
189+
if [ -n "$CUSTOM_PACKS" ]; then
190+
PACKS=$(echo "$CUSTOM_PACKS" | tr ',' ' ')
191+
echo "Installing custom packs: $PACKS"
192+
elif [ "$INSTALL_ALL" = true ]; then
188193
PACKS="$ALL_PACKS"
189194
echo "Installing all $(echo "$PACKS" | wc -l | tr -d ' ') packs..."
190195
else

tests/install.bats

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,25 @@ print('OK')
264264
[ -f "$INSTALL_DIR/packs/peon/openpeon.json" ]
265265
[ ! -f "$INSTALL_DIR/packs/peon/manifest.json" ]
266266
}
267+
268+
@test "--packs installs only specified packs" {
269+
bash "$CLONE_DIR/install.sh" --packs=peon,glados
270+
[ -d "$INSTALL_DIR/packs/peon" ]
271+
[ -d "$INSTALL_DIR/packs/glados" ]
272+
# Should NOT have other default packs
273+
[ ! -d "$INSTALL_DIR/packs/peasant" ]
274+
[ ! -d "$INSTALL_DIR/packs/duke_nukem" ]
275+
}
276+
277+
@test "--packs with single pack works" {
278+
bash "$CLONE_DIR/install.sh" --packs=peon
279+
[ -d "$INSTALL_DIR/packs/peon" ]
280+
pack_count=$(ls -d "$INSTALL_DIR/packs/"*/ 2>/dev/null | wc -l | tr -d ' ')
281+
[ "$pack_count" -eq 1 ]
282+
}
283+
284+
@test "--packs overrides default pack list" {
285+
bash "$CLONE_DIR/install.sh" --packs=glados
286+
[ -d "$INSTALL_DIR/packs/glados" ]
287+
[ ! -d "$INSTALL_DIR/packs/peon" ]
288+
}

0 commit comments

Comments
 (0)