-
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
Gitea
committed
Mar 17, 2024
1 parent
f6fab7d
commit f27d686
Showing
3 changed files
with
46 additions
and
2 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,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Colors for output | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
NC='\033[0m' # No Color | ||
|
||
# Print in colors - 1=green, 2=red, other=neutral | ||
# e.g. log_print 0 "All is great" | ||
log_print() { | ||
if [[ $1 == 1 ]]; then | ||
echo -e "${GREEN}${2}${NC}" | ||
elif [[ $1 == 2 ]]; then | ||
echo -e "${RED}${2}${NC}" | ||
else | ||
echo -e "${2}" | ||
fi | ||
} | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
# Function used to check if utilities are available | ||
require() { | ||
if ! hash "$1" &>/dev/null; then | ||
log_print 2 "'$1' not found in PATH. This is required for this script to work." | ||
exit 1 | ||
fi | ||
} | ||
|
||
require curl | ||
require tar | ||
|
||
download_wizer_binary() { | ||
log_print 0 "Downloading wizer" | ||
local archive_url="https://github.com/bytecodealliance/wizer/releases/download/v5.0.0/wizer-v5.0.0-x86_64-linux.tar.xz" | ||
log_print 1 "Downloading wizer: $archive_url" | ||
curl --progress-bar --show-error --location --fail $archive_url --output "wizer-v5.0.0.tar.xz" | ||
tar -xvf "wizer-v5.0.0.tar.xz" | ||
} | ||
|
||
download_wizer_binary |
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