Skip to content

Commit

Permalink
Updated gen_version script from GRSISort version of it
Browse files Browse the repository at this point in the history
  • Loading branch information
VinzenzBildstein committed Aug 19, 2024
1 parent 05a84b0 commit c16ed89
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions util/gen_version.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/bin/bash

if [ `uname` == 'Darwin' ]; then
script_dir=$(dirname $(greadlink -f "$0"))
if [ "$(uname)" == "Darwin" ]; then
script_name=$(greadlink -f "$0")
else
script_dir=$(dirname $(readlink -f "$0"))
script_name=$(readlink -f "$0")
fi
script_dir=$(dirname "$script_name")

include_file="$script_dir"/../include/GRSIDataVersion.h

release_commit=$(git describe --abbrev=0 --match="v*" --tags)
release_num=$(echo "$release_commit" | sed -e 's/v//')
release_time=$(git show -s --format=%ai "$release_commit" | tail -n 1)
release_num=${release_commit//v/}
release_time=$(git show -s --pretty=format:%ai "$release_commit" | tail -n 1)
release_name=$(git rev-parse "$release_commit" | xargs git cat-file -p | tail -n1)

git_commit=$(git describe --tags)
git_branch=$(git branch | sed -n '/\* /s///p')
git_commit_time=$(git show -s --format=%ai "$git_commit" | tail -n 1)
git_commit_time=$(git show -s --pretty=format:%ai "$git_commit" | tail -n 1)

read -r -d '' file_contents <<EOF
#ifndef GRSIDATAVERSION_H
Expand Down

0 comments on commit c16ed89

Please sign in to comment.