File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 shell : bash
3232 run : |
3333 chmod +x install-cli.sh
34- bash bin/test_install_script.sh
34+ bash bin/test_install_script.sh --token ${{ secrets.GITHUB_TOKEN }}
3535
3636 mac-homebrew :
3737 name : Test Homebrew Installation on macOS
5353 shell : bash
5454 run : |
5555 chmod +x install-cli.sh
56- bash bin/test_install_script_over_homebrew.sh
56+ bash bin/test_install_script_over_homebrew.sh --token ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 22
33# Note: set -e is intentionally omitted here to allow manual exit code checking.
44
5- # Attempt to run the install script
6- ./install-cli.sh
5+ # --- Configuration ---
6+ TOKEN=" "
7+
8+ # Parse arguments for the test script itself, primarily to pass --token
9+ while [[ " $# " -gt 0 ]]; do
10+ case $1 in
11+ --token)
12+ if [[ -n " $2 " && " $2 " != --* ]]; then
13+ TOKEN=" $2 "
14+ shift
15+ else
16+ echo " Error: --token requires a value"
17+ exit 1
18+ fi
19+ ;;
20+ * ) echo " Unknown parameter: $1 " ; exit 1 ;;
21+ esac
22+ shift
23+ done
24+
25+ # Helper to construct command
26+ run_install () {
27+ local cmd=" ./install-cli.sh"
28+ if [ -n " $TOKEN " ]; then
29+ cmd=" $cmd --token $TOKEN "
30+ fi
31+ # Add other arguments passed to function
32+ cmd=" $cmd $@ "
33+ echo " Running: $cmd "
34+ $cmd
35+ }
36+
37+ # Run the install script
38+ run_install
739
840# Capture the exit code of the install script
941EXIT_CODE=$?
You can’t perform that action at this time.
0 commit comments