Skip to content

Commit 4fde88a

Browse files
committed
switched to awk for macOS compability
1 parent cc9546b commit 4fde88a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

other/tools/run_protoc.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ command -v protoc-gen-mavsdk > /dev/null || {
2424
}
2525

2626
function snake_case_to_camel_case {
27-
if [[ "$OSTYPE" == "darwin"* ]]; then
28-
echo $1 | gsed -r 's/(^|_)([a-z])/\U\2/g'
29-
else
30-
echo $1 | sed -r 's/(^|_)([a-z])/\U\2/g'
31-
fi
27+
echo $1 | awk -v FS="_" -v OFS="" '{for (i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1'
3228
}
3329

3430
function generate {

0 commit comments

Comments
 (0)