docs/dirtyCheck.sh
Ron Stone 090becd41e Consolidate utils (r8,4 r7, r6, r5)
Many bash functions are duplicated across scripts. This commit
consolidates them on one file for more efficient managment.

Some incidental updates were made:
- set default start date in pickCompare to today-9 months instead of 2020-01-01.
  This reduces clutter when selecting authors and stale gerrits in output.
- fix a routine used by normalize-includes

Signed-off-by: Ron Stone <ronald.stone@windriver.com>
Change-Id: Ifd64e38fbe4324c7d6b4eccb725ef3d8367f6578
2023-07-26 18:05:59 +00:00

23 lines
583 B
Bash
Executable File

#!/bin/bash
. $(pwd)/_utils.sh
if [[ -z ${utils_loaded+x} ]]; then echo "Could not load utilities"; exit 1; fi
declare -a dirtyFiles
dirtyFiles=( $(git status --porcelain doc/source 2>/dev/null) )
message "Checking status of doc/source"
if [ ${#dirtyFiles[@]} -ne 0 ]; then
warn "Repo is dirty. Please stash, add or manually delete the following files:\n"
for file in ${dirtyFiles[@]};
do
if [[ ${file} == "??" ]]; then continue; fi
if [[ ${file} == "M" ]]; then continue; fi
warn "$file"
done
exit 1
else
confirmation "... OK"
fi