Fixes bug in save_remote_file function in bpkg-install

The bug occurred if a save-path did not exists. The function now attempts to create the directory before trying to save a file to it.
pull/102/head
Ben Peachey 6 years ago committed by Joseph Werle
parent 72c9a90e3f
commit ba0308f5c3

@ -89,6 +89,13 @@ save_remote_file () {
path="${2}"
auth_param="${3:-}"
local dirname="$(dirname "${path}")"
# Make sure directory exists
if [[ ! -d "${dirname}" ]];then
mkdir -p "${dirname}"
fi
if [[ "${auth_param}" ]];then
curl --silent -L -o "${path}" -u "${auth_param}" "${url}"
else

Loading…
Cancel
Save