File tree Expand file tree Collapse file tree 1 file changed +22
-22
lines changed Expand file tree Collapse file tree 1 file changed +22
-22
lines changed Original file line number Diff line number Diff line change 39
39
abort ' Bash must not run in POSIX mode. Please unset POSIXLY_CORRECT and try again.'
40
40
fi
41
41
42
- usage () {
43
- cat << EOS
44
- Homebrew Installer
45
- Usage: [NONINTERACTIVE=1] [CI=1] install.sh [options]
46
- -h, --help Display this message.
47
- NONINTERACTIVE Install without prompting for user input
48
- CI Install in CI mode (e.g. do not prompt for user input)
49
- EOS
50
- exit " ${1:- 0} "
51
- }
52
-
53
- while [[ $# -gt 0 ]]
54
- do
55
- case " $1 " in
56
- -h | --help) usage ;;
57
- * )
58
- warn " Unrecognized option: '$1 '"
59
- usage 1
60
- ;;
61
- esac
62
- done
63
-
64
42
# string formatters
65
43
if [[ -t 1 ]]
66
44
then
@@ -98,6 +76,28 @@ warn() {
98
76
printf " ${tty_red} Warning${tty_reset} : %s\n" " $( chomp " $1 " ) " >&2
99
77
}
100
78
79
+ usage () {
80
+ cat << EOS
81
+ Homebrew Installer
82
+ Usage: [NONINTERACTIVE=1] [CI=1] install.sh [options]
83
+ -h, --help Display this message.
84
+ NONINTERACTIVE Install without prompting for user input
85
+ CI Install in CI mode (e.g. do not prompt for user input)
86
+ EOS
87
+ exit " ${1:- 0} "
88
+ }
89
+
90
+ while [[ $# -gt 0 ]]
91
+ do
92
+ case " $1 " in
93
+ -h | --help) usage ;;
94
+ * )
95
+ warn " Unrecognized option: '$1 '"
96
+ usage 1
97
+ ;;
98
+ esac
99
+ done
100
+
101
101
# Check if script is run non-interactively (e.g. CI)
102
102
# If it is run non-interactively we should not prompt for passwords.
103
103
# Always use single-quoted strings with `exp` expressions
You can’t perform that action at this time.
0 commit comments