From: Nelson Castillo <[email protected]> Make sure we are in a valid branch to avoid OM developers some trouble.
* Print a nice message if we are not in a valid branch. Please feel free to edit the error message if you think it is not clear enough. Signed-off-by: Nelson Castillo <[email protected]> --- build | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/build b/build index 58e24c7..67b01ab 100755 --- a/build +++ b/build @@ -63,6 +63,13 @@ if [ -z "$PRODUCT" ] ; then exit 1 fi + +# +# make sure we are in a valid branch +# + +[[ `git-branch | head -1` =~ "* (no branch)" ]] && echo -e "\nThere is no branch in the local copy of the repository right now!\nHint: type git-branch, make sure you are in a valid branch and then try again" && exit 1 + # # get the branch and head hash for the version we are building to # allow source tracability
