vsrccopy: fix detection of last argument

This commit is contained in:
Đoàn Trần Công Danh 2023-08-30 22:46:25 +07:00
parent da8a19b5ab
commit a6c4206699

View file

@ -173,7 +173,7 @@ vsrccopy() {
if [ $# -lt 2 ]; then if [ $# -lt 2 ]; then
msg_error "vsrccopy <file>... <target>" msg_error "vsrccopy <file>... <target>"
fi fi
_tgt="${@:-1}" _tgt="${@: -1}"
mkdir -p "$_tgt" mkdir -p "$_tgt"
while [ $# -gt 1 ]; do while [ $# -gt 1 ]; do
cp -a "${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1" "$_tgt" cp -a "${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1" "$_tgt"