Skip to content

Commit 5e213e7

Browse files
author
Damian Rouson
committed
Gussied up the tree output on the opening screen of installation output and added the display
of a static file of saved tree output on systems that lack the 'tree' command. Signed-off-by: Damian Rouson <[email protected]>
1 parent d06dffa commit 5e213e7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

install.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,16 @@ print_header()
638638
echo "*** and ask permission to download, build, and install any missing ***"
639639
echo "*** prerequisites: ***"
640640
echo ""
641-
tree $opencoarrays_src_dir/doc/dependency_tree | tail -n+2
641+
# Move to a directory tree whose structure mirrors the dependency tree
642+
pushd $opencoarrays_src_dir/doc/dependency_tree/ > /dev/null
643+
if type tree &> /dev/null; then
644+
# dynamically compute and print the tree, suppressing the final line
645+
tree opencoarrays | sed '$d'
646+
else
647+
# print the most recently saved static depiction of the tree
648+
cat opencoarrays-tree.txt
649+
fi
650+
popd > /dev/null
642651
echo ""
643652
echo "*** All prerequisites will be downloaded to, built in, and installed in ***"
644653
echo "$opencoarrays_src_dir/install_prerequisites"
@@ -689,7 +698,9 @@ report_results()
689698
echo ""
690699
echo "$install_path/bin."
691700
echo ""
692-
rm $install_path/setup.sh
701+
if [[ -f $install_path/setup.sh ]]; then
702+
rm $install_path/setup.sh
703+
fi
693704
# Prepend the OpenCoarrays license to the setup.sh script:
694705
while IFS='' read -r line || [[ -n "$line" ]]; do
695706
echo "# $line" >> $install_path/setup.sh

0 commit comments

Comments
 (0)