aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-update
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-11-15 08:32:45 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-11-15 08:32:45 +0200
commit040db42ed01f3077a7222c890acd8cf7fd298cdc (patch)
tree1582cd5416bb21bde971c0a008b55434bfa91bc9 /bin/ak-update
parent45347c19d5e0e99deedc8834d59cd466431c11f8 (diff)
downloadarching-kaos-tools-040db42ed01f3077a7222c890acd8cf7fd298cdc.tar.gz
arching-kaos-tools-040db42ed01f3077a7222c890acd8cf7fd298cdc.tar.bz2
arching-kaos-tools-040db42ed01f3077a7222c890acd8cf7fd298cdc.zip
do it right
Diffstat (limited to 'bin/ak-update')
-rwxr-xr-xbin/ak-update19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/ak-update b/bin/ak-update
new file mode 100755
index 0000000..71b91b6
--- /dev/null
+++ b/bin/ak-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