2018-11-02 18:52:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
directory="$1"
|
|
|
|
|
|
|
|
if test "$directory" = ""; then
|
|
|
|
directory=$(pwd)
|
|
|
|
fi
|
2018-11-02 19:07:49 +00:00
|
|
|
directory=$(realpath "$directory")
|
2018-11-02 18:52:38 +00:00
|
|
|
|
|
|
|
pushd $directory
|
|
|
|
|
|
|
|
git clone "https://github.com/overflowerror/NurseBot" "git"
|
|
|
|
|
|
|
|
mkdir versions
|
|
|
|
|
|
|
|
mkdir -p git/build/NurseBot_lib
|
|
|
|
|
|
|
|
if test "$(ls git/build/NurseBot_lib)" = ""; then
|
2018-11-02 19:07:49 +00:00
|
|
|
echo
|
2018-11-02 18:52:38 +00:00
|
|
|
echo "Libs are missing."
|
|
|
|
echo "Please copy them to $directory/git/build/NurseBot_lib"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd git/buildtools
|
|
|
|
|
|
|
|
./update.sh
|
|
|
|
./build.sh ../../
|
|
|
|
if test ! $? = 0; then
|
|
|
|
echo "Build failed."
|
|
|
|
popd
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
version=$(./versions.sh ../../ | tail -n 1)
|
|
|
|
./deploy.sh ../../ $version
|
|
|
|
|
|
|
|
cd ../..
|
|
|
|
|
2018-11-02 19:00:45 +00:00
|
|
|
cp "$directory"/git/config.properties.default "$directory"/config.properties
|
2018-11-02 18:52:38 +00:00
|
|
|
|
2018-11-02 19:00:45 +00:00
|
|
|
ln -s "$directory"/git/buildtools/nursebot.sh ./
|
|
|
|
ln -s "$directory"/git/build/NurseBot_lib ./
|
2018-11-02 18:52:38 +00:00
|
|
|
|
|
|
|
popd
|
2018-11-02 19:11:28 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Everything seems allright."
|
|
|
|
echo "Don't forget to edit config.perperties."
|
|
|
|
echo
|
|
|
|
echo "Have fun!"
|