scripts: fix the check for GitHub authentication token

When the script is invoked via dev_cli.sh, it always gets AUTH_DOWNLOAD_TOKEN
from the environment. The original test always returns true.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2023-11-08 06:36:23 +00:00 committed by Rob Bradford
parent aad5cd7858
commit 14907d0752

View File

@ -109,7 +109,7 @@ process_common_args() {
}
download_hypervisor_fw() {
if [ -v AUTH_DOWNLOAD_TOKEN ]; then
if [ -n "$AUTH_DOWNLOAD_TOKEN" ]; then
echo "Using authenticated download from GitHub"
FW_URL=$(curl --silent https://api.github.com/repos/cloud-hypervisor/rust-hypervisor-firmware/releases/latest \
--header "Authorization: Token $AUTH_DOWNLOAD_TOKEN" \