Update meson.build not to fail if git rev-parse fails

This commit is contained in:
Ethan D. Twardy 2022-07-20 06:57:34 -05:00 committed by Jente Hidskes Ankarberg
parent 1b9d750dc2
commit a81ab701d7

View file

@ -77,8 +77,8 @@ endif
version = '@0@'.format(meson.project_version()) version = '@0@'.format(meson.project_version())
git = find_program('git', native: true, required: false) git = find_program('git', native: true, required: false)
if git.found() if git.found()
git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: true) git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'], check: false)
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: true) git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
if git_commit.returncode() == 0 and git_branch.returncode() == 0 if git_commit.returncode() == 0 and git_branch.returncode() == 0
version = '@0@-@1@ (branch \'@2@\')'.format( version = '@0@-@1@ (branch \'@2@\')'.format(
meson.project_version(), meson.project_version(),