COMMIT_ID updater

This commit is contained in:
Eriks Karls 2020-02-26 18:18:47 +02:00
parent dd2c20cc41
commit 62e265e7e1
2 changed files with 11 additions and 0 deletions

View File

@ -88,3 +88,9 @@ dist: clean ## builds source and wheel package
install: clean ## install the package to the active Python's site-packages
python setup.py install
setcommit:
bash set_commit_id.sh
# commit=`git log -1 --pretty=format:%h`
# sed -i.bak -E "s|COMMIT_ID = \".+\"|COMMIT_ID = \"$(commit)\"|g" erepublik/utils.py
# mv erepublik/utils.py.bak erepublik/utils.py

5
set_commit_id.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
commit=$(git log -1 --pretty=format:%h)
sed -i.bak -E "s|COMMIT_ID = \".+\"|COMMIT_ID = \"${commit}\"|g" erepublik/utils.py
rm erepublik/utils.py.bak