Skip to content

Commit baf7b8f

Browse files
committed
Merge pull request #1226 from UV-CDAT/issue_1224_setup_runtime_msg
Added message in setup_runtime scripts
2 parents 102701b + aed46d1 commit baf7b8f

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

CMake/cdat_modules_extra/setup_runtime.csh.in

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ endif
2222
# which can lead to errors.
2323
if ( $?UVCDAT_SETUP_PATH ) then
2424
if ( ${UVCDAT_SETUP_PATH} == ${install_prefix} ) then
25-
echo 'UVCDAT setup already sourced for this install location.'
26-
exit 1
25+
echo 'Nothing to do since UVCDAT is already setup at '${UVCDAT_SETUP_PATH}
26+
exit 0
2727
else
2828
echo 'ERROR: UVCDAT setup was previously sourced at '${UVCDAT_SETUP_PATH}
29-
echo 'Open a new shell in order to use a different install location.'
29+
echo 'ERROR: There is no need to run setup_runtime manually anymore.'
30+
echo 'ERROR: Open a new shell in order to use a different install location.'
3031
exit 1
3132
endif
3233
endif
@@ -91,3 +92,7 @@ setenv UVCDAT_SETUP_PATH ${install_prefix}
9192

9293
unset install_prefix
9394

95+
echo 'Successfully updated your environment to use UVCDAT'
96+
echo '(changes are valid for this session/terminal only)'
97+
echo 'Version: '${UVCDAT_PROMPT_STRING}
98+
echo 'Location: '${UVCDAT_SETUP_PATH}

CMake/cdat_modules_extra/setup_runtime.sh.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ function cleanup {
1010
# which can lead to errors.
1111
if [ -n "${UVCDAT_SETUP_PATH}" ] ; then
1212
if [ "${UVCDAT_SETUP_PATH}" = "${install_prefix}" ] ; then
13+
echo "Nothing to do since UVCDAT is already setup at: ${UVCDAT_SETUP_PATH}" 1>&2
1314
cleanup
1415
return 0
1516
else
16-
echo "ERROR: UVCDAT setup was previously sourced at \"${UVCDAT_SETUP_PATH}\"" 1>&2
17+
echo "ERROR: UVCDAT setup was previously sourced at: ${UVCDAT_SETUP_PATH}" 1>&2
1718
echo "ERROR: There is no need to run setup_runtime manually anymore." 1>&2
1819
echo "ERROR: Open a new shell in order to use a different install location." 1>&2
1920
cleanup
@@ -23,7 +24,7 @@ fi
2324

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

8687
export UVCDAT_SETUP_PATH="${install_prefix}"
8788
cleanup
89+
echo "Successfully updated your environment to use UVCDAT" 1>&2
90+
echo "(changes are valid for this session/terminal only)" 1>&2
91+
echo "Version: ${UVCDAT_PROMPT_STRING}" 1>&2
92+
echo "Location: ${UVCDAT_SETUP_PATH}" 1>&2
8893
return 0

0 commit comments

Comments
 (0)