#!/bin/bash

echo -n $( dirname -- "$( readlink -f -- "$0" )" ) > pwd.txt

CWD=$(cat pwd.txt)

i=0
for package_dir in $(find . -mindepth 1 -maxdepth 1 -type d)
do
    i=$(( $i + 1 ))
    echo "$i $CWD/$package_dir"
    cd $CWD/$package_dir
    git pull
    cd $CWD
    echo ""
done

echo "Ready"
sleep 5
kill $(ps x | grep konsole | grep $0 | awk '{print $1}')
