mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
scripts intended as local git hooks. post-merge: - create symlink ESPEasy - if necessary - add "#define BUILD_GIT <git revision>" to Custom.h - add "#define USE_CUSTOM_H" to src/ESPEasy-Globals.h post-commit: - add "#define BUILD_GIT <git revision>" to Custom.h post-checkout: - on branch checkout also add "#define BUILD_GIT <git revision>"
11 lines
280 B
Bash
Executable File
11 lines
280 B
Bash
Executable File
#!/bin/bash
|
|
# purpose: GIT post-commit
|
|
# change value of BUILD_GIT macro
|
|
#
|
|
WORKDIR=src
|
|
CUSTOM_H=${WORKDIR}/Custom.h
|
|
GLOBAL_H=${WORKDIR}/ESPEasy-Globals.h
|
|
|
|
[[ -f ${CUSTOM_H} ]] && \
|
|
sed -i.bak -e "s/\(#define BUILD_GIT\).*/\1 $(git log -1 --pretty=format:%h HEAD)/" ${CUSTOM_H}
|