From 90e65da3d76f626bae14bdea3b57b0bcfe2f75b4 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 28 Feb 2022 18:54:26 -0300 Subject: [PATCH] Fix mv error --- pkgbuild.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgbuild.sh b/pkgbuild.sh index e69e67e..3f253d2 100755 --- a/pkgbuild.sh +++ b/pkgbuild.sh @@ -9,7 +9,7 @@ visudo -c chmod -R a+rw . baseDir="$PWD" -# [ -n "$INPUT_PKGDIR" ] && inBaseDir=true || inBaseDir=false +[ -n "$INPUT_PKGDIR" ] && inBaseDir=true || inBaseDir=false cd "${INPUT_PKGDIR:-.}" oldFiles=$(find -H "$PWD") @@ -17,14 +17,12 @@ sudo -u nobody makepkg -s --noconfirm sudo -u nobody makepkg --printsrcinfo > .SRCINFO echo "::set-output name=srcInfo::.SRCINFO" -# [ $inBaseDir = false ] && mv .SRCINFO /github/workspace -mv -f .SRCINFO /github/workspace +[ $inBaseDir = false ] && mv .SRCINFO /github/workspace pkgFile=$(sudo -u nobody makepkg --packagelist) relPkgFile="$(realpath --relative-base="$baseDir" "$pkgFile")" echo "::set-output name=pkgFile::$relPkgFile" -# [ $inBaseDir = false ] && mv "$pkgFile" /github/workspace -mv -f "$pkgFile" /github/workspace +[ $inBaseDir = false ] && mv "$pkgFile" /github/workspace newFiles=$(find -H "$PWD") toRemove=$(printf '%s\n%s\n' "$newFiles" "$oldFiles" | sort | uniq -u)