Skip to content

Commit

Permalink
feat: allow skipping downloads using SIGINT
Browse files Browse the repository at this point in the history
Downloads get skipped using SIGINT instead of terminating script
  • Loading branch information
sudoAlphaX committed Jul 12, 2024
1 parent aeb14a7 commit 1b10afc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,9 @@ function web_pipe() {

# Download a file from the web
function web_get() {

trap 'echo && echo "Skipping download" && echo' SIGINT

local CHECK=""
local HEADERS=()
local URL="${1}"
Expand Down Expand Up @@ -1253,6 +1256,8 @@ function web_get() {
echo "ERROR! Failed to download ${URL} with curl."
rm -f "${DIR}/${FILE}"
fi

trap 'exit' SIGINT
}

# checks if a URL needs to be redirected and returns the final URL
Expand Down

0 comments on commit 1b10afc

Please sign in to comment.