diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-11-15 08:28:38 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-11-15 08:28:38 +0200 |
commit | 45347c19d5e0e99deedc8834d59cd466431c11f8 (patch) | |
tree | c2000475cf37fa416b6b14b1191d05f50b570111 /bin | |
parent | bf3a3339206bd816251d52a596884326ca1f968a (diff) | |
download | arching-kaos-tools-45347c19d5e0e99deedc8834d59cd466431c11f8.tar.gz arching-kaos-tools-45347c19d5e0e99deedc8834d59cd466431c11f8.tar.bz2 arching-kaos-tools-45347c19d5e0e99deedc8834d59cd466431c11f8.zip |
new command: update
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update | 19 |
1 files changed, 19 insertions, 0 deletions
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 |