proxmox-nag-buster/make-release.sh

24 lines
702 B
Bash
Raw Normal View History

#!/bin/sh
2021-05-02 01:51:28 +00:00
_VERS="v04"
_BRANCH=$(git rev-parse --abbrev-ref HEAD) >/dev/null 2>&1 ||
{ echo "can't poll branch, defaulting to master" && _BRANCH="master"; }
# update versions before packing install.sh
2020-01-21 11:58:55 +00:00
sed -i -r \
-e "s;\(v[[:digit:]][[:digit:]].?\);\($_VERS\);" \
-e "s;(nag-buster/).*(/(pve-nag-buster|install)\.sh);\1$_BRANCH\2;" \
pve-nag-buster.sh install.sh README.md
2020-01-21 11:58:55 +00:00
# TODO there's probably a two liner to handle all of this in awk:
# pack install.sh
{
head -n"$(grep -n "<< 'YEET'" install.sh | cut -d: -f1)" install.sh
xz -z -9 -c pve-nag-buster.sh | base64
tail -n+"$(grep -n '^YEET$' install.sh | cut -d: -f1)" install.sh
} > foofile
cat foofile > install.sh
rm -f foofile