Joey Armstrong | a2db6cd | 2023-11-30 12:16:18 -0500 | [diff] [blame] | 1 | # -*- makefile -*- |
| 2 | ## ----------------------------------------------------------------------- |
| 3 | ## Intent: Targets in this makefile will determine if locally modified |
| 4 | ## files exist in the sandbox. VOLTHA currently uses this logic to |
| 5 | ## detect when go {tidy, update} have indirectly modified vendor go.mod |
| 6 | ## files during a build or test. |
| 7 | ## ----------------------------------------------------------------------- |
| 8 | |
| 9 | $(error DISABLED -- not yet deployed/in use) |
| 10 | |
| 11 | # $(MAKE) --no-print-directory detect-local-edits |
| 12 | |
| 13 | ## --------------------------------------------------------------------- |
| 14 | ## Intent: Determine if sandbox contains locally modified files |
| 15 | ## --------------------------------------------------------------------- |
| 16 | clean-tree := git status --porcelain |
| 17 | detect-local-edits: |
| 18 | $(HIDE)[[ `$(clean-tree)` == "" ]] || {\ |
| 19 | echo "ERROR: Untracked files detected, commit or remove to continue" \ |
| 20 | && echo "`git status`" \ |
| 21 | && exit 1; } |
| 22 | |
| 23 | # [EOF] |