cd $THIS_DIR

This commit is contained in:
Yago 2015-04-07 00:27:13 +02:00
parent 1d243dfa8c
commit cac8fe7999

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
THIS_DIR=$(cd $(dirname $0); pwd)
cd $THIS_DIR
update() {
git pull
@ -60,13 +61,13 @@ if [ "$1" = "install" ]; then
elif [ "$1" = "update" ]; then
update
else
if [ ! -f $THIS_DIR/tg/telegram.h ]; then
if [ ! -f ./tg/telegram.h ]; then
echo "tg not found"
echo "Run $0 install"
exit 1
fi
if [ ! -f $THIS_DIR/tg/bin/telegram-cli ]; then
if [ ! -f ./tg/bin/telegram-cli ]; then
echo "tg binary not found"
echo "Run $0 install"
exit 1
@ -75,5 +76,5 @@ else
PREFIX="$THIS_DIR/.luarocks"
export LUA_CPATH=";;${PREFIX}/lib/lua/5.2/?.so"
export LUA_PATH=";;${PREFIX}/share/lua/5.2/?.lua;${PREFIX}/share/lua/5.2/?/init.lua"
$THIS_DIR/tg/bin/telegram-cli -k $THIS_DIR/tg/tg-server.pub -s $THIS_DIR/bot/bot.lua -l 1
./tg/bin/telegram-cli -k ./tg/tg-server.pub -s ./bot/bot.lua -l 1
fi