cysamurai 2 months ago
parent e54ee18b58
commit 67f8b14ff6

@ -28,6 +28,7 @@ OUTPUT_ROOT="$REPO_ROOT/dist/linux-deb"
ARM64_PKGCONFIG_DIR="/usr/lib/aarch64-linux-gnu/pkgconfig"
X64_PKGCONFIG_DIR="/usr/lib/x86_64-linux-gnu/pkgconfig"
AVAILABLE_PROJECTS=()
POSITIONAL_ARGS=()
usage() {
cat <<EOF
@ -56,6 +57,7 @@ process.exit(scripts["build:deb:x64"] && scripts["build:deb:arm64"] ? 0 : 1);
}
parse_args() {
POSITIONAL_ARGS=()
while (($# > 0)); do
case "$1" in
--arch)
@ -102,7 +104,7 @@ parse_args() {
esac
if (($# > 0)); then
printf '%s\n' "$@"
POSITIONAL_ARGS=("$@")
fi
}
@ -266,8 +268,8 @@ select_projects() {
}
main() {
local -a positional to_build
mapfile -t positional < <(parse_args "$@")
local -a to_build
parse_args "$@"
mapfile -t AVAILABLE_PROJECTS < <(discover_projects)
if (( ${#AVAILABLE_PROJECTS[@]} == 0 )); then
echo "错误: 未发现可构建项目(需包含 build:deb:x64 与 build:deb:arm64 脚本)" >&2
@ -279,7 +281,7 @@ main() {
return
fi
mapfile -t to_build < <(select_projects "${positional[@]}")
mapfile -t to_build < <(select_projects "${POSITIONAL_ARGS[@]}")
mkdir -p "$OUTPUT_ROOT"
for p in "${to_build[@]}"; do

Loading…
Cancel
Save