Skip to content

Commit

Permalink
Merge pull request #1423 from mavlink/pr-macos-sed
Browse files Browse the repository at this point in the history
tools: fix snake_case_to_camel_case for macOS
  • Loading branch information
julianoes committed Apr 30, 2021
2 parents b1c1188 + 6a73cb7 commit 7f9e123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/generate_from_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ protoc_binary="${third_party_dir}/install/bin/protoc"
protoc_grpc_binary="${third_party_dir}/install/bin/grpc_cpp_plugin"

function snake_case_to_camel_case {
echo $1 | sed -r 's/(^|_)([a-z])/\U\2/g'
echo $1 | awk -v FS="_" -v OFS="" '{for (i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1'
}

command -v ${protoc_binary} > /dev/null && command -v ${protoc_grpc_binary} > /dev/null || {
Expand Down

0 comments on commit 7f9e123

Please sign in to comment.