#!/bin/sh # ~jhs/bin/tidy_after_vi # Called by ~jhs/src/bsd/fixes/FreeBSD/src/gen/share/mk/berklix.mk # Calls /usr/local/bin/tidy yes() { # echo Calling tidy $* # Note this $* is not params passed to this file script, # but params passed to this procedure by caller. tidy -i -m $* # If there were error that tidy has fixed, it exits non zero, # that used to get passed back to berklix.mk, # which errored out before it could call # rm -f ${.TARGET} # to remove the .vhtml temporary file exit 0 } no() { echo "Skipping tidy -i -m $*" } echo -n "tidy $* ? " read edit # echo EDIT is $edit case ${edit} in [Nn][Oo]) no $* ;; [Nn]) no $* ;; [Yy][Ee][Ss]) yes $* ;; [Yy]) yes $* ;; *) echo Error, Bad Answer, should be Yes or No, Assuming No. no ;; esac