-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Description: | ||
# Translates the current cpu architecture to the a rust triple. | ||
# | ||
# # # # | ||
|
||
CURRENT_ARCH=$(uname -m) | ||
|
||
if [ "$CURRENT_ARCH" = "armv7l" ]; then | ||
CURRENT_ARCH="armv7" | ||
fi | ||
|
||
# Iterate all folders in the target folder | ||
for arch_folder in $(find target -maxdepth 1 -type d); do | ||
# Check if the folder name contains the current arch | ||
if [[ "$arch_folder" = *"$CURRENT_ARCH"* ]]; then | ||
RUST_TRIPLE=$(echo "$arch_folder" | sed -e "s/.*\///g") | ||
echo "$RUST_TRIPLE" | ||
exit 0 | ||
fi | ||
done | ||
|
||
exit 1 |