#!/bin/sh

# SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
# SPDX-License-Identifier: LGPL-3.0-or-later

set -e

action=$1
url=$2
output=$3

if [ "$action" != "download" ]; then
    echo "unsupported file source action: $action" >&2
    exit 1
fi

if ! command -v wget >/dev/null 2>&1; then
    echo "wget not found, please install wget first" >&2
    exit 1
fi

wget "$url" -O "$output"
