restructed update script for staging-data-hoarder

This commit is contained in:
Tassilo - 2022-07-13 20:10:42 +02:00
parent 1df5b086cf
commit 667a7bb974
Signed by: revol-xut
GPG Key ID: 4F56FF7759627D07
1 changed files with 21 additions and 7 deletions

View File

@ -11,27 +11,41 @@ let
NAME=$1
if [ $NAME = "staging-data-hoarder" ]; then
SRC=https://github.com/dump-dvb/nix-config.git
SRC_NIX_CONFIG=https://github.com/dump-dvb/nix-config.git
SRC_DUMP_DVB=https://github.com/dump-dvb/dump-dvb.nix.git
BRANCH=master
DIR=dvb-dump
DIR_NIX_CONFIG=dvb-dump
DIR_DUMP_DVB=dvb-dump
else
echo "Do not know what to do"
exit 0
fi
cd /tmp
if [ -d $DIR ]; then
cd $DIR
if [ -d $DIR_DUMP_DVB ]; then
cd $DIR_DUMP_DVB
git fetch origin
git reset --hard origin/$BRANCH
else
git clone -b $BRANCH --single-branch $SRC $DIR
cd $DIR
git clone -b $BRANCH --single-branch $SRC $DIR_DUMP_DVB
cd $DIR_DUMP_DVB
fi
nix flake update
cd /tmp
if [ -d $DIR_NIX_CONFIG ]; then
cd $DIR_NIX_CONFIG
git fetch origin
git reset --hard origin/$BRANCH
else
git clone -b $BRANCH --single-branch $SRC $DIR_NIX_CONFIG
cd $DIR_NIX_CONFIG
fi
git config --global user.email "astro@spaceboyz.net"
git config --global user.name "Updater"
nix flake update --commit-lock-file
nix flake update --commit-lock-file --override-input dump-dvb ../$DIR_DUMP_DVB
''}/bin/realize-flake";
in
{