Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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}
7 changes: 6 additions & 1 deletion 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.

Quotes are wrong

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.

why can't the var be outside the quotes?

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.

actually per: http://wiki.bash-hackers.org/syntax/quoting the quotes are probably not even needed here...

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.

echo "Nothing to do UVCDAT is already setup at ${UVCDAT_SETUP_PATH}" 1>&2
or
echo "Nothing to do UVCDAT is already setup at \"${UVCDAT_SETUP_PATH}\"" 1>&2
are probably what you meant

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.

i definitely don't want the quotes in the output, and since we are doing an echo of strings the quotes are actually not necessary. What I have in there is right. But I really don't care and we want to keep @remram44 happy so I will push an update right away with the quotes around the var.

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
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.

Quotes were right and are now wrong?

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.

echo "ERROR: UVCDAT setup was previously sourced at ${UVCDAT_SETUP_PATH}" 1>&2
or
echo "ERROR: UVCDAT setup was previously sourced at \"${UVCDAT_SETUP_PATH}\"" 1>&2
are probably what you meant

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 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