aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-update
blob: dc040cbd4a7ba584432bf6de73f52d0d692c1e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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