From acbf463942475dfaab044d6bf84c599bf0ddd75a Mon Sep 17 00:00:00 2001 From: Simon Let Date: Sun, 8 Jan 2023 20:51:53 +0100 Subject: [PATCH] Return the warning for new installs, cosmetic fixes --- scripts/hooks.sh | 7 ++----- scripts/install.sh | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/scripts/hooks.sh b/scripts/hooks.sh index ae1833a..e639838 100644 --- a/scripts/hooks.sh +++ b/scripts/hooks.sh @@ -21,9 +21,6 @@ __resh_reload_shellrc() { # => The `__resh_preexec` function needs to exist in all future versions. # => Make sure that `__RESH_NO_RELOAD` behavior is not broken in any future version. # => Prefer only testing `__RESH_NO_RELOAD` for emptyness instead of specific value -# Other: -# - Return status code of `resh-collect` and `resh-postcollect` commands from `__resh_preexec` and `__resh_precmd` respectively. -# - Even nested calls of `__resh_preexec` should propagate the status. # (pre)collect @@ -37,8 +34,8 @@ __resh_preexec() { # Reload shell files and restart __resh_preexec - i.e. the full command will be recorded only with a slight delay. # This should happens in every already open terminal after resh update. - # If `$2` is non-empty we play it safe, don't reload, and leave it up to resh-collect to error because of `--required-version` option. - # This behavior gives user and error instead of handling things silently and risking infinite recursion. + # If for any reason the __RESH_VERSION is still wrong we don't reload again to prevent potentially infinite recursion. + # User will most likely see error because of `resh-collect -requiredVersion`. __resh_reload_shellrc # Rerun self but prevent another reload. Extra protection against infinite recursion. diff --git a/scripts/install.sh b/scripts/install.sh index 05a0bcd..290b845 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -205,7 +205,13 @@ ISSUES & FEEDBACK Please report issues to: https://github.com/curusarn/resh/issues Feedback and suggestions are very welcome! " - +if [ -z "${__RESH_VERSION:-}" ]; then info="$info +############################################################## +# # +# Finish the installation by RESTARTING this terminal! # +# # +##############################################################" +fi info="$info ---- Close this by pressing Q ----" @@ -216,3 +222,11 @@ echo "All done!" echo "Thank you for using RESH" echo "Report issues here: https://github.com/curusarn/resh/issues" echo "Ctrl+R launches the RESH SEARCH app" + +if [ -z "${__RESH_VERSION:-}" ]; then printf " +############################################################## +# # +# Finish the installation by RESTARTING this terminal! # +# # +##############################################################\n" +fi \ No newline at end of file