Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
505ef25d9This file is pinned to the selected release. Download the original to open it in your design tool.
#!/bin/sh
## This code should be copied into .git/hooks/post-commit
## It will run automatically after every new commit, and will copy the newest GIT hash
## into a file to be included by the c code.
version_str=`git describe --always --dirty=-D`
top_level_dir=$(git rev-parse --show-toplevel)
filename=Code_for_microcontroller/YbTempCtrl/latest_hash.h
echo Writing latest version value = $version_str
echo to "$top_level_dir/$filename"
echo \#define LATEST_HASH \""$version_str"\" > "$top_level_dir/$filename"
echo Marking file as unchanged so git ignores it
git update-index --assume-unchanged "$top_level_dir/$filename"
exit 0