Skip to content
Snippets Groups Projects
Unverified Commit 5c7f2675 authored by Michal Hrusecky's avatar Michal Hrusecky :mouse:
Browse files

Check working directory


Make sure we are not being run from the checkout directory.

Signed-off-by: default avatarMichal Hrusecky <Michal@Hrusecky.net>
parent fa5c85a6
No related merge requests found
......@@ -49,7 +49,13 @@ _die() {
exit 1
}
if [ "$BUILD_DIR" == "$SRCDIR" ]; then
_die "You should run this script from build directory\nIt will delete content of current working directory!"
fi
_get_version() {
# If first grep fails - version is not first non-empty, add 999 to the end
# Be aware that Condition in if also outputs the results
if ! grep . "${SRC_DIR}"/NEWS | head -n 1 | grep '^[0-9.]\+$'; then
echo "$(grep '^[0-9.]\+$' "${SRC_DIR}"/NEWS | head -n 1).999"
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment