Archive : Fix local unarchive.

This commit is contained in:
Dmitry Voronin 2024-03-13 00:24:52 +03:00
parent 9ad7ff4701
commit 46b01f05b3

View file

@ -246,16 +246,16 @@ function unarchive() {
if [[ "${target//\\:/}" == *:* ]]; then
local host="${target%%:*}"
file="${target#*:}"
remote=("sudo" "ssh" "${host}")
remote=(sudo ssh ${host})
fi
# Extract.
case "${file##*.}" in
"txz")
${remote[@]} "pv -f" ${file} | xz -d | tar -xf -
${remote[@]} pv -f ${file} | xz -d | tar -xf -
;;
"tgz")
${remote[@]} "pv -f" ${file} | gzip -d | tar -xf -
${remote[@]} pv -f ${file} | gzip -d | tar -xf -
;;
esac
}