From 45347c19d5e0e99deedc8834d59cd466431c11f8 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 15 Nov 2024 08:28:38 +0200 Subject: new command: update --- bin/update | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/update (limited to 'bin') diff --git a/bin/update b/bin/update new file mode 100755 index 0000000..71b91b6 --- /dev/null +++ b/bin/update @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ -L $AK_WORKDIR/bin/ak ] +then + $source_dir ="$(ls -l $AK_WORKDIR/bin/ak | rev | cut -d ' ' -f 1 | rev | sed 's/bin\/ak//')" +else + echo "Can't update... ak script is not a link" + exit 1 +fi + +if [ -d ${source_dir} ] && [ -d ${source_dir}/.git ] +then + cd ${source_dir} + git pull + ./update.sh +else + echo "Can't update... source not found or not a git repository" + exit 1 +fi -- cgit v1.2.3