mirror of https://github.com/curusarn/resh
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.5 KiB
27 lines
1.5 KiB
#!/hint/sh
|
|
|
|
# util.sh - resh utility functions
|
|
|
|
__resh_session_init() {
|
|
if [ "$__RESH_VERSION" != "$(resh-session-init -version)" ]; then
|
|
# shellcheck source=shellrc.sh
|
|
source ~/.resh/shellrc
|
|
if [ "$__RESH_VERSION" != "$(resh-session-init -version)" ]; then
|
|
echo "RESH WARNING: You probably just updated RESH - PLEASE RESTART OR RELOAD THIS TERMINAL SESSION (resh version: $(resh-session-init -version); resh version of this terminal session: ${__RESH_VERSION})"
|
|
else
|
|
echo "RESH INFO: New RESH shellrc script was loaded - if you encounter any issues please restart this terminal session."
|
|
fi
|
|
elif [ "$__RESH_REVISION" != "$(resh-session-init -revision)" ]; then
|
|
# shellcheck source=shellrc.sh
|
|
source ~/.resh/shellrc
|
|
if [ "$__RESH_REVISION" != "$(resh-session-init -revision)" ]; then
|
|
echo "RESH WARNING: You probably just updated RESH - PLEASE RESTART OR RELOAD THIS TERMINAL SESSION (resh revision: $(resh-session-init -revision); resh revision of this terminal session: ${__RESH_REVISION})"
|
|
fi
|
|
fi
|
|
if [ "$__RESH_VERSION" = "$(resh-session-init -version)" ] && [ "$__RESH_REVISION" = "$(resh-session-init -revision)" ]; then
|
|
resh-session-init -requireVersion "$__RESH_VERSION" \
|
|
-requireRevision "$__RESH_REVISION" \
|
|
-sessionId "$__RESH_SESSION_ID" \
|
|
-sessionPid "$__RESH_SESSION_PID"
|
|
fi
|
|
}
|
|
|