Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMake/cdat_modules_extra/setup_runtime.csh.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ endif
# which can lead to errors.
if ( $?UVCDAT_SETUP_PATH ) then
if ( ${UVCDAT_SETUP_PATH} == ${install_prefix} ) then
echo 'UVCDAT setup already sourced for this install location.'
echo 'Nothing to do UVCDAT is already setup at '${UVCDAT_SETUP_PATH}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:
'Nothing to do since UVCDAT is already setup at '${UVCDAT_SETUP_PATH}

exit 1
else
echo 'ERROR: UVCDAT setup was previously sourced at '${UVCDAT_SETUP_PATH}
echo 'Open a new shell in order to use a different install location.'
echo 'ERROR: There is no need to run setup_runtime manually anymore.'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not mark it as error instead use INFO:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok changing this but using exit 0 then rather than exit 1

echo 'ERROR: Open a new shell in order to use a different install location.'
exit 1
endif
endif
Expand Down Expand Up @@ -91,3 +92,7 @@ setenv UVCDAT_SETUP_PATH ${install_prefix}

unset install_prefix

echo 'Successfully updated your environment to use UV-CDAT'
echo '(changes are valid for this session/terminal only)'
echo 'Version: '${UVCDAT_PROMPT_STRING}
echo 'Location: '${UVCDAT_SETUP_PATH}
9 changes: 7 additions & 2 deletions CMake/cdat_modules_extra/setup_runtime.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ function cleanup {
# which can lead to errors.
if [ -n "${UVCDAT_SETUP_PATH}" ] ; then
if [ "${UVCDAT_SETUP_PATH}" = "${install_prefix}" ] ; then
echo "Nothing to do UVCDAT is already setup at: ${UVCDAT_SETUP_PATH}" 1>&2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

cleanup
return 0
else
echo "ERROR: UVCDAT setup was previously sourced at \"${UVCDAT_SETUP_PATH}\"" 1>&2
echo "ERROR: UVCDAT setup was previously sourced at: ${UVCDAT_SETUP_PATH}" 1>&2
echo "ERROR: There is no need to run setup_runtime manually anymore." 1>&2
echo "ERROR: Open a new shell in order to use a different install location." 1>&2
cleanup
Expand All @@ -23,7 +24,7 @@ fi

# Check that the install prefix exists, otherwise stop.
if [ ! -d "${install_prefix}" ] ; then
echo "ERROR: \"${install_prefix}\" is not a directory." 1>&2
echo "ERROR: ${install_prefix} is not a directory." 1>&2
cleanup
return 1
fi
Expand Down Expand Up @@ -85,4 +86,8 @@ export PYTHONPATH

export UVCDAT_SETUP_PATH="${install_prefix}"
cleanup
echo "Successfully updated your environment to use UV-CDAT" 1>&2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use UV-CDAT or UVCDAT but not both. Earlier you used UVCDAT

echo "(changes are valid for this session/terminal only)" 1>&2
echo "Version: ${UVCDAT_PROMPT_STRING}" 1>&2
echo "Location: ${UVCDAT_SETUP_PATH}" 1>&2
return 0