Install bpf-sdk if none exists (#58)

This commit is contained in:
Jack May 2020-06-24 15:05:22 -07:00 committed by GitHub
parent af8b4b17e6
commit 921f88f582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

19
do.sh
View File

@ -106,8 +106,8 @@ perform_action() {
>>"${dump}-mangled.txt" >>"${dump}-mangled.txt"
sed \ sed \
s/://g \ s/://g \
< "${dump}-mangled.txt" \ <"${dump}-mangled.txt" |
| rustfilt \ rustfilt \
> "${dump}.txt" > "${dump}.txt"
else else
echo "Warning: No dump created, cannot find: $so" echo "Warning: No dump created, cannot find: $so"
@ -127,21 +127,24 @@ perform_action() {
} }
set -e set -e
if [[ "$#" -ne 2 ]]; then
if [[ $1 == "update" ]]; then if [[ $1 == "update" ]]; then
perform_action "$1" perform_action "$1"
else else
# Build all projects if [[ ! -d "$sdkDir" ]]; then
./do.sh update
fi
fi
if [[ "$#" -ne 2 ]]; then
# Perform operation on all projects
for project in */; do for project in */; do
if [[ -f "$project"Cargo.toml ]]; then if [[ -f "$project"Cargo.toml ]]; then
perform_action "$1" "$PWD/$project" "$project" perform_action "$1" "$PWD/$project" "$project"
else else
continue; continue
fi fi
done done
fi
else else
# Build requested project # Perform operation on requested project
perform_action "$1" "$PWD/$2" "$2" perform_action "$1" "$PWD/$2" "$2"
fi fi