diff options
author | Florian Pritz <bluewind@xinu.at> | 2024-10-14 21:34:04 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2024-10-14 21:54:03 +0200 |
commit | d5ffb01d87852eb74f6b17ae06ac0c476010065b (patch) | |
tree | 1ac6a86d874f30c968ba26bf0f8a5954fa0c67a6 /pkgctl | |
parent | d10ee7703e20ef844907e90797ad66bf0fb984da (diff) | |
download | bin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.gz bin-d5ffb01d87852eb74f6b17ae06ac0c476010065b.tar.xz |
Add new scripts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'pkgctl')
-rwxr-xr-x | pkgctl | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/bin/bash + +cleanup_logs() { + if [[ -f PKGBUILD ]]; then + shopt -s nullglob + + dir="." + files=("$dir/"*.log "$dir/"*.log.*) + if [[ -f "${files[0]}" ]]; then + mkdir -p "$dir/logs" + mv "${files[@]}" "$dir/logs/" || return + gzip -f "$dir/logs/"*.log "$dir/logs/"*.log.{1,2,3,4,5,6,7,8,9} + fi + fi +} + +/usr/bin/pkgctl "$@" +exitcode=$? + +if [[ "$1" == "build" ]]; then + cleanup_logs +fi + +exit "$exitcode" |