cd $THIS_DIR
This commit is contained in:
parent
1d243dfa8c
commit
cac8fe7999
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
THIS_DIR=$(cd $(dirname $0); pwd)
|
THIS_DIR=$(cd $(dirname $0); pwd)
|
||||||
|
cd $THIS_DIR
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
git pull
|
git pull
|
||||||
@ -60,13 +61,13 @@ if [ "$1" = "install" ]; then
|
|||||||
elif [ "$1" = "update" ]; then
|
elif [ "$1" = "update" ]; then
|
||||||
update
|
update
|
||||||
else
|
else
|
||||||
if [ ! -f $THIS_DIR/tg/telegram.h ]; then
|
if [ ! -f ./tg/telegram.h ]; then
|
||||||
echo "tg not found"
|
echo "tg not found"
|
||||||
echo "Run $0 install"
|
echo "Run $0 install"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $THIS_DIR/tg/bin/telegram-cli ]; then
|
if [ ! -f ./tg/bin/telegram-cli ]; then
|
||||||
echo "tg binary not found"
|
echo "tg binary not found"
|
||||||
echo "Run $0 install"
|
echo "Run $0 install"
|
||||||
exit 1
|
exit 1
|
||||||
@ -75,5 +76,5 @@ else
|
|||||||
PREFIX="$THIS_DIR/.luarocks"
|
PREFIX="$THIS_DIR/.luarocks"
|
||||||
export LUA_CPATH=";;${PREFIX}/lib/lua/5.2/?.so"
|
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"
|
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
|
fi
|
||||||
|
Reference in New Issue
Block a user