Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Improved build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewerr committed Mar 30, 2018
1 parent f2c6c56 commit 7ba1fce
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
if [ ! $# -eq 2 ]
if [ ! $# -eq 2 ] #FIXME:normal way of chceking whether -n argument used
then
echo "╔╦╗╔╦╗╔═╗╔═╗╔═╗╦═╗"
echo " ║║ ║║║ ║╚═╗║╣ ╠╦╝"
Expand All @@ -11,6 +11,12 @@ if [ $# -eq 0 ]
echo -n "Usage:"
echo -n $0
echo " [-h] [debug|release|clean|update] [-n]"
echo " -h - display this message"
echo " -n - do not display logo"
echo " debug - build for debug(no optimization)"
echo " release - build for release(maximum optimization)"
echo " clean - delete old build"
echo " update - try automatically download new version and build it for release"
exit -1
fi

Expand All @@ -19,7 +25,13 @@ if [ $1 == "-h" ]
echo -n "Usage:"
echo -n $0
echo " [-h] [debug|release|clean|update] [-n]"
exit -1
echo " -h - display this message"
echo " -n - do not display logo"
echo " debug - build for debug(no optimization)"
echo " release - build for release(maximum optimization)"
echo " clean - delete old build"
echo " update - try automatically download new version and build it for release"
exit 0
fi

if [ $1 = "clean" ]
Expand Down Expand Up @@ -53,6 +65,17 @@ if [ $1 = "update" ]
then
echo "Updating..."
git pull
if [ $? != 0 ]
then
echo "+----------------|ERROR!!!|----------------+"
echo "|git pull failed! |"
echo "|It seems that you need to update manually |"
echo "|To update manually clone repository again |"
echo "|(using git clone) and build (using this |"
echo "|script) |"
echo "+------------------------------------------+"
exit -1
fi
./$0 clean -n
./$0 release -n
exit
Expand Down

0 comments on commit 7ba1fce

Please sign in to comment.