Skip to content

Commit

Permalink
Suggest removal of txt/html files from checkins
Browse files Browse the repository at this point in the history
  • Loading branch information
martinthomson committed Sep 22, 2023
1 parent 9e41fe6 commit eb41d49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
drafts=("$@")
candidates=$((${#drafts[@]} * 5))
versioned="${VERSIONED:-versioned}"
txt_html_warning="$(mktemp)"
trap 'rm -f "$txt_html_warning"' EXIT

next() {
printf "${1%-*}-%2.2d" $((1${1##*-} - 99))
Expand All @@ -35,6 +37,11 @@ build_target() {
source_file=
subst=()
for file in $(git ls-tree --name-only "$tag" | grep '^draft-'); do
if [ "${file##*.}" = "txt" -o "${file##*.}" = "html" ]; then
echo "warning: $file is checked in at revision $tag" 1>&2
rm -f "$txt_html_warning"
continue
fi
if [ "${file%.*}" = "${target_name%-*}" ]; then
source_file="$file"
file_tag="$target_name"
Expand Down Expand Up @@ -111,3 +118,8 @@ for draft in "${drafts[@]%.*}"; do
fi
fi
done

if [ ! -e "$txt_html_warning" ]; then
echo "warning: checked in txt or html files can cause issues" 1>&2
echo "warning: remove these files with \`git rm\`" 1>&2
fi

0 comments on commit eb41d49

Please sign in to comment.