local/bin/homeinit: Delete git repository without prompting the user

master
Pierre Neidhardt 2019-01-22 17:19:41 +01:00
parent b1f2927c06
commit b4ad9c8354
1 changed files with 4 additions and 1 deletions

View File

@ -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)"