aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/buildenv.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-03-17 20:52:36 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-03-18 12:45:24 +0000
commitb7e1b8299ceb7b071975225a0b1c0b3436363490 (patch)
tree52a12165769b845a3631e17fdc836f7223ace378 /scripts/bootstrap/buildenv.sh
parent9116b3e99af2fd31d92c9bb7c37905a1675456c1 (diff)
Fix build when no CHANGELOG.md exists.
This was actually not breaking the build, just outputing an error -- MOS_MIGRATED_REVID=117481375
Diffstat (limited to 'scripts/bootstrap/buildenv.sh')
-rwxr-xr-xscripts/bootstrap/buildenv.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 3b7956c271..93825132d7 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -191,8 +191,13 @@ function git_date() {
# Get the latest release version and append the date of
# the last commit if any.
function get_last_version() {
- local version="$(fgrep -m 1 '## Release' CHANGELOG.md \
- | sed -E 's|.*Release (.*) \(.*\)|\1|')"
+ if [ -f "CHANGELOG.md" ]; then
+ local version="$(fgrep -m 1 '## Release' CHANGELOG.md \
+ | sed -E 's|.*Release (.*) \(.*\)|\1|')"
+ else
+ local version=""
+ fi
+
local date="$(git_date)"
if [ -z "${version-}" ]; then
version="unknown"