/
githubmirror
/
grafana
Обзор
Документация
Войти
/
githubmirror
/
grafana
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
scripts/clean-git-or-error.sh
27 строк
795 B
sam boyer
Do codegen and check no-diff of all (non-blacklisted) CUE->TS codegen during CI (#39922)
08 окт 2021, 15:47
Не верифицирован
08 окт 2021, 15:47
0fe200c
Код
Авторство
О чём код?
#!/bin/bash set -e # Checks that a git working tree is clean. Exit 0 if it is, or exit 1 with a list of # dirty files - including modifications, removals, and untracked+unignored files. # Primarily intended for ensuring in CI that codegen operations are a no-op/have # already been performed. STAT="$(git status --porcelain 2>/dev/null)" if [ -z "$STAT" ] then exit 0 else echo "$STAT" exit 1 fi # For safekeeping, alternative commands that meet a similar goal (in case the # above approach ends up being problematic) # # List modified/removed files and exit nonzero if any exist: # git diff --stat --exit-code # # List untracked files, and exit nonzero if any exist: # git ls-files --others --exclude-standard', # u="$(git ls-files --others --exclude-standard)" && test -z "$u"