Add runScript()

This commit is contained in:
Santiago Lo Coco 2022-02-28 20:08:23 -03:00
parent ce619c7603
commit 9923bfc641
1 changed files with 24 additions and 20 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
runScript() {
set -euo pipefail set -euo pipefail
pacman -Syu --noconfirm base-devel pacman -Syu --noconfirm base-devel
@ -27,3 +28,6 @@ echo "::set-output name=pkgFile::$relPkgFile"
newFiles=$(find -H "$PWD" -not -path '*.git*') newFiles=$(find -H "$PWD" -not -path '*.git*')
mapfile -t toRemove < <(printf '%s\n%s\n' "$newFiles" "$oldFiles" | sort | uniq -u) mapfile -t toRemove < <(printf '%s\n%s\n' "$newFiles" "$oldFiles" | sort | uniq -u)
rm -rf "${toRemove[@]}" rm -rf "${toRemove[@]}"
}
runScript "$@"