File tree 2 files changed +37
-19
lines changed
2 files changed +37
-19
lines changed Original file line number Diff line number Diff line change @@ -129,3 +129,39 @@ function os::util::find-go-binary() {
129
129
done
130
130
}
131
131
readonly -f os::util::find-go-binary
132
+
133
+ # os::util::sed attempts to make our Bash scripts agnostic to the platform
134
+ # on which they run `sed` by glossing over a discrepancy in flag use in GNU.
135
+ #
136
+ # Globals:
137
+ # None
138
+ # Arguments:
139
+ # - all: arguments to pass to `sed -i`
140
+ # Return:
141
+ # None
142
+ function os::util::sed() {
143
+ if LANG=C sed --help 2>&1 | grep -q " GNU sed" ; then
144
+ sed -i' ' " $@ "
145
+ else
146
+ sed -i ' ' " $@ "
147
+ fi
148
+ }
149
+ readonly -f os::util::sed
150
+
151
+ # os::util::base64decode attempts to make our Bash scripts agnostic to the platform
152
+ # on which they run `base64decode` by glossing over a discrepancy in flag use in GNU.
153
+ #
154
+ # Globals:
155
+ # None
156
+ # Arguments:
157
+ # - all: arguments to pass to `base64decode`
158
+ # Return:
159
+ # None
160
+ function os::util::base64decode() {
161
+ if [[ " $( go env GOHOSTOS) " == " darwin" ]]; then
162
+ base64 -D " $@ "
163
+ else
164
+ base64 -d " $@ "
165
+ fi
166
+ }
167
+ readonly -f os::util::base64decode
Original file line number Diff line number Diff line change @@ -543,22 +543,4 @@ readonly -f find_files
543
543
function os::util::host_platform() {
544
544
echo " $( go env GOHOSTOS) /$( go env GOHOSTARCH) "
545
545
}
546
- readonly -f os::util::host_platform
547
-
548
- function os::util::sed() {
549
- if LANG=C sed --help 2>&1 | grep -qs " GNU sed" ; then
550
- sed -i' ' " $@ "
551
- else
552
- sed -i ' ' " $@ "
553
- fi
554
- }
555
- readonly -f os::util::sed
556
-
557
- function os::util::base64decode() {
558
- if [[ " $( go env GOHOSTOS) " == " darwin" ]]; then
559
- base64 -D $@
560
- else
561
- base64 -d $@
562
- fi
563
- }
564
- readonly -f os::util::base64decode
546
+ readonly -f os::util::host_platform
You can’t perform that action at this time.
0 commit comments