aboutsummaryrefslogtreecommitdiff
path: root/auto-void-packages/commit-push-pr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'auto-void-packages/commit-push-pr.sh')
-rwxr-xr-xauto-void-packages/commit-push-pr.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/auto-void-packages/commit-push-pr.sh b/auto-void-packages/commit-push-pr.sh
index 1352c73..687adc7 100755
--- a/auto-void-packages/commit-push-pr.sh
+++ b/auto-void-packages/commit-push-pr.sh
@@ -3,31 +3,42 @@
helpy(){
-printf "command: %s <package> <version> <tested>\n" "$0"
+printf "command: %s <package> <version> <tested> [path]\n" "$0"
printf "package: package name\n"
printf "version: version update\n"
printf "tested: yes/briefly/no\n"
+printf "path (optional): path of architectures file, defaults to '\$HOME/workbench/auto-void-packages/architectures.txt'\n"
}
+###
[ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] && helpy && exit 1
PKG="$1"
VER="$2"
-TESTED="$3"
+tested="$3"
+archs_fp="${4:-$HOME/workbench/auto-void-packages/architectures.txt}"
+
+# The third variable must be yes, briefly or no
+[[ ! $tested =~ (yes|briefly|no) ]] && helpy && exit 1
+
+###
+
printf "Updating %s to %s.\n" "$PKG" "$VER"
pushd ~/workbench/void-packages || exit 1
+# git stuff
git add "srcpkgs/$PKG" && \
git commit -m "$PKG: update to $VER" && \
git push origin "$PKG-update"
-ARCHS=$(/bin/cat "$HOME/workbench/auto-void-packages/architectures.txt")
+ARCHS=$(/bin/cat "$archs_fp")
+# github stuff
gh pr create \
--title "$PKG: update to $VER" \
--body "#### Testing the changes
-- I tested the changes in this PR: **$TESTED**
+- I tested the changes in this PR: **$tested**
#### Local build testing
- I built this PR locally for my native architecture, x86_64