diff --git a/pkgbuild.sh b/pkgbuild.sh index 913cad1..e69e67e 100755 --- a/pkgbuild.sh +++ b/pkgbuild.sh @@ -9,6 +9,7 @@ visudo -c chmod -R a+rw . baseDir="$PWD" +# [ -n "$INPUT_PKGDIR" ] && inBaseDir=true || inBaseDir=false cd "${INPUT_PKGDIR:-.}" oldFiles=$(find -H "$PWD") @@ -16,12 +17,14 @@ sudo -u nobody makepkg -s --noconfirm sudo -u nobody makepkg --printsrcinfo > .SRCINFO echo "::set-output name=srcInfo::.SRCINFO" -sudo mv .SRCINFO /github/workspace +# [ $inBaseDir = false ] && mv .SRCINFO /github/workspace +mv -f .SRCINFO /github/workspace pkgFile=$(sudo -u nobody makepkg --packagelist) relPkgFile="$(realpath --relative-base="$baseDir" "$pkgFile")" echo "::set-output name=pkgFile::$relPkgFile" -sudo mv "$pkgFile" /github/workspace +# [ $inBaseDir = false ] && mv "$pkgFile" /github/workspace +mv -f "$pkgFile" /github/workspace newFiles=$(find -H "$PWD") toRemove=$(printf '%s\n%s\n' "$newFiles" "$oldFiles" | sort | uniq -u)