Merge pull request #265 from marineam/json

fix(release_util): Generate correct download path for official releases
This commit is contained in:
Michael Marineau 2014-06-02 14:02:13 -07:00
commit bb6a18fbb8

View File

@ -191,10 +191,21 @@ download_image_url() {
fi fi
local download_root="${FLAGS_download_root:-${UPLOAD_ROOT}}" local download_root="${FLAGS_download_root:-${UPLOAD_ROOT}}"
local download_path="${download_root%%/}/boards/${BOARD}/${COREOS_VERSION_STRING}"
local download_path
if [[ -n "${FLAGS_download_path}" ]]; then if [[ -n "${FLAGS_download_path}" ]]; then
download_path="${FLAGS_download_path%%/}" download_path="${FLAGS_download_path%%/}"
elif [[ "${download_root}" = *release.core-os.net* ]]; then
# Official release download paths don't include the boards directory
download_path="${download_root%%/}/${BOARD}/${COREOS_VERSION_STRING}"
else
download_path="${download_root%%/}/boards/${BOARD}/${COREOS_VERSION_STRING}"
fi fi
echo "http://${download_path#gs://}/$1" # Just in case download_root was set from UPLOAD_ROOT
if [[ "${download_path}" == gs://* ]]; then
download_path="http://${download_path#gs://}"
fi
echo "${download_path}/$1"
} }