#!/usr/bin/env bash # ARG_OPTIONAL_SINGLE([release],[],[],[]) # ARGBASH_GO() # needed because of Argbash --> m4_ignore([ ### START OF CODE GENERATED BY Argbash v2.9.0 one line above ### # Argbash is a bash code generator used to get arguments parsing right. # Argbash is FREE SOFTWARE, see https://argbash.io for more info # Generated online by https://argbash.io/generate die() { local _ret="${2:-1}" test "${_PRINT_HELP:-no}" = yes && print_help >&2 echo "$1" >&2 exit "${_ret}" } begins_with_short_option() { local first_option all_short_options='' first_option="${1:0:1}" test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0 } # THE DEFAULTS INITIALIZATION - OPTIONALS _arg_release="" print_help() { printf 'Usage: %s [--release ]\n' "$0" } parse_commandline() { while test $# -gt 0; do _key="$1" case "$_key" in --release) test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1 _arg_release="$2" shift ;; --release=*) _arg_release="${_key##--release=}" ;; *) _PRINT_HELP=yes die "FATAL ERROR: Got an unexpected argument '$1'" 1 ;; esac shift done } parse_commandline "$@" # OTHER STUFF GENERATED BY Argbash ### END OF CODE GENERATED BY Argbash (sortof) ### ]) # [ <-- needed because of Argbash set -o errexit set -o xtrace target=$(rustc -vV | sed -n 's|host: ||p') cargo build --verbose --release gzip --verbose --stdout "target/release/unreferenced_files" >"${target}.gz" gh release upload "${_arg_release}" "${target}.gz" # ] <-- needed because of Argbash