Skip to content

Commit 8f075ad

Browse files
committed
Add back download_app_package to lib.sh
1 parent 0b8e674 commit 8f075ad

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/scripts/utils/lib.sh

+28
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,31 @@ function build_current_version {
284284
echo "GUI e2e executable for current version already exists at $gui_test_bin, skipping build"
285285
fi
286286
}
287+
288+
function download_app_package {
289+
local version=$1
290+
local os=$2
291+
local package_repo=""
292+
293+
if is_dev_version "$version"; then
294+
package_repo="${BUILD_DEV_REPOSITORY}"
295+
else
296+
package_repo="${BUILD_RELEASE_REPOSITORY}"
297+
fi
298+
299+
local filename
300+
filename=$(get_app_filename "$version" "$os")
301+
local url="${package_repo}/$version/$filename"
302+
303+
local package_dir
304+
package_dir=$(get_package_dir)
305+
if [[ ! -f "$package_dir/$filename" ]]; then
306+
echo "Downloading build for $version ($os) from $url"
307+
if ! curl -sf -o "$package_dir/$filename" "$url"; then
308+
echo "Failed to download package from $url (hint: build may not exist, check the url)" 1>&2
309+
exit 1
310+
fi
311+
else
312+
echo "App package for version $version ($os) already exists at $package_dir/$filename, skipping download"
313+
fi
314+
}

0 commit comments

Comments
 (0)