1
0

fix: update usage instructions to support optional group argument in package installation scripts

This commit is contained in:
2025-08-05 00:12:43 -05:00
parent 1b9d9424b4
commit 1b55f3f173
2 changed files with 20 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# scripts/30-install-packages.sh - Install packages from package lists
# scripts/30-install-packages.sh - Wrapper to invoke packages module
set -euo pipefail
@@ -9,16 +9,19 @@ source "$SCRIPT_DIR/utils.sh"
# Run module when called directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
if [ $# -ne 1 ]; then
log_error "Usage: $0 <dotfiles_directory>"
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
log_error "Usage: $0 <dotfiles_directory> [group]"
exit 1
fi
dotfiles_dir="$1"
module_script="$dotfiles_dir/packages/install.sh"
# Group to install, default to base.txt
group_arg="${2:-base.txt}"
if [ ! -f "$module_script" ]; then
log_error "Module script not found: $module_script"
exit 1
fi
bash "$module_script" "$dotfiles_dir"
# Always invoke module with desired group
bash "$module_script" "$dotfiles_dir" "$group_arg"
fi