local/bin/homeinit: Delete git repository without prompting the user
parent
b1f2927c06
commit
b4ad9c8354
|
@ -162,11 +162,14 @@ section "System packages"
|
|||
if inpath guix; then
|
||||
if [ ! -e ~/.cache/guix/pull ]; then
|
||||
message "Update Guix to yesterday's version"
|
||||
## TODO: This clones the repository twice, which is a bit dumb, but cloning
|
||||
## locally and then running `guix pull --url=/tmp/guix` produces a different
|
||||
## hash in ~/.cache/guix/...
|
||||
git clone https://git.savannah.gnu.org/git/guix.git /tmp/guix
|
||||
YESTERDAY_COMMIT=$(git -C /tmp/guix log --until=yesterday -n 1 --format=%H)
|
||||
guix pull --commit=$YESTERDAY_COMMIT
|
||||
unset YESTERDAY_COMMIT
|
||||
rm -rv /tmp/guix
|
||||
rm -rfv /tmp/guix
|
||||
elif $OPT_UPDATE; then
|
||||
CURRENT_COMMIT=$(guix --version 2>/dev/null | awk '{print $4; exit}')
|
||||
REPO=$HOME/.cache/guix/pull/"$(ls -1 ~/.cache/guix/pull)"
|
||||
|
|
Loading…
Reference in New Issue