Print a simple directory tree to verify a template's contents using find + sed if tree(1) is not installed
This commit is contained in:
@@ -99,11 +99,13 @@ verify_template() {
|
|||||||
cat "${_path}"
|
cat "${_path}"
|
||||||
echo
|
echo
|
||||||
while read _dir; do
|
while read _dir; do
|
||||||
if [ -x /usr/local/bin/tree ]; then
|
|
||||||
echo -e "${COLOR_GREEN}[${_hook}]:[${_dir}]:${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}[${_hook}]:[${_dir}]:${COLOR_RESET}"
|
||||||
tree -a ${_template_path}/${_dir}
|
if [ -x /usr/local/bin/tree ]; then
|
||||||
|
/usr/local/bin/tree -a ${_template_path}/${_dir}
|
||||||
|
else
|
||||||
|
find "${_template_path}/${_dir}" -print | sed -e 's;[^/]*/;|___;g;s;___|; |;g'
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
fi
|
|
||||||
done < ${_path}
|
done < ${_path}
|
||||||
else
|
else
|
||||||
echo -e "${COLOR_GREEN}[${_hook}]:${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}[${_hook}]:${COLOR_RESET}"
|
||||||
|
|||||||
Reference in New Issue
Block a user