Skip to content

Commit fd4c1bc

Browse files
committed
Add macOS US House convenience menu
1 parent 31fc669 commit fd4c1bc

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
SCRIPT="$(cd "$(dirname "$0")" && pwd)/US-House-Apps.sh"
5+
6+
if [[ ! -x "$SCRIPT" ]]; then
7+
chmod +x "$SCRIPT"
8+
fi
9+
10+
if [[ "${1:-menu}" != "menu" ]]; then
11+
exec "$SCRIPT" "$@"
12+
fi
13+
14+
cat <<'MENU'
15+
US HOUSE — macOS SOFTWARE CONVENIENCE
16+
1. List catalog
17+
2. Install
18+
3. Update
19+
4. Remove
20+
5. Status
21+
6. Upgrade all
22+
7. Repair
23+
8. Exit
24+
MENU
25+
26+
read -r -p 'Select: ' choice
27+
case "$choice" in
28+
1) exec "$SCRIPT" list ;;
29+
2) action=install ;;
30+
3) action=update ;;
31+
4) action=remove ;;
32+
5) action=status ;;
33+
6) exec "$SCRIPT" upgrade-all ;;
34+
7) action=repair ;;
35+
8) exit 0 ;;
36+
*) echo 'Invalid selection.'; exit 2 ;;
37+
esac
38+
39+
read -r -p 'Vendor (microsoft/apple): ' vendor
40+
read -r -p 'Package alias: ' package
41+
exec "$SCRIPT" "$action" "$vendor" "$package"

0 commit comments

Comments
 (0)