Skip to content

Commit

Permalink
Lint quickget
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed May 3, 2024
1 parent f56c72b commit 966ccd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function os_info() {
function show_os_info() {
while getopts ":12345" opt; do
case $opt in
1|2|3|4|5) os_info "${2}" | cut -d'|' -f${opt};;
1|2|3|4|5) os_info "${2}" | cut -d'|' -f"${opt}";;
*) error_not_supported_argument;;
esac
done
Expand All @@ -158,7 +158,7 @@ PRETTY_NAME=$(show_os_info -1 "${OS}")
# Just in case quickget want use it in future
# shellcheck disable=SC2005,SC2317
function os_homepage(){
echo $(show_os_info -4 "${1}")
echo "$(show_os_info -4 "${1}")"
}

function error_specify_os() {
Expand Down Expand Up @@ -1249,7 +1249,7 @@ function web_get() {
fi

if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then
echo Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION:+ $EDITION}
echo Downloading "${PRETTY_NAME}" "${RELEASE}" "${EDITION:+ $EDITION}"
echo "- URL: ${URL}"
fi

Expand Down Expand Up @@ -1316,7 +1316,7 @@ function zsync_get() {
echo "ERROR! Unable to create directory ${DIR}"
exit 1
fi
echo -e Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n'
echo -e Downloading "${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}\n"
# Only force http for zsync - not earlier because we might fall through here
if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
echo "ERROR! Failed to download ${URL/https/http}.zsync"
Expand Down Expand Up @@ -2131,9 +2131,9 @@ function get_manjaro() {
[[ ${RELEASE} != "sway" ]] && MANIFEST="$(web_pipe https://gitlab.manjaro.org/web/iso-info/-/raw/master/file-info.json)"
[[ ${EDITION} == "minimal" && ${TYPE} != "sway" ]] && EDITION=".minimal" || EDITION=""
if [[ ${RELEASE} != "sway" ]]; then
URL="$(echo ${MANIFEST} | jq -r .${TYPE}.${RELEASE}${EDITION}.image)"
URL="$(echo "${MANIFEST}" | jq -r .${TYPE}.${RELEASE}${EDITION}.image)"
else
URL=$(echo ${MANIFEST} | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url')
URL=$(echo "${MANIFEST}" | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url')
fi
HASH=$(web_pipe "${URL}.sha512" | cut_1)
echo "${URL} ${HASH}"
Expand Down

0 comments on commit 966ccd7

Please sign in to comment.