better version checking

bump version to 1.1.1
pull/15/head
Simon Let 7 years ago
parent 68bf682799
commit a1f6632d8f
  1. 6
      Makefile
  2. 4
      collect/resh-collect.go
  3. 88
      shellrc.sh
  4. 2
      version

@ -10,7 +10,7 @@ autoinstall:
build: submodules resh-collect resh-daemon build: submodules resh-collect resh-daemon
install: build | $(HOME)/.resh $(HOME)/.resh/bin $(HOME)/.config $(HOME)/.resh/resh-uuid install: build submodules/bash-preexec/bash-preexec.sh shellrc.sh config.toml uuid.sh | $(HOME)/.resh $(HOME)/.resh/bin $(HOME)/.config
# Copying files to resh directory ... # Copying files to resh directory ...
cp -f submodules/bash-preexec/bash-preexec.sh ~/.bash-preexec.sh cp -f submodules/bash-preexec/bash-preexec.sh ~/.bash-preexec.sh
cp -f config.toml ~/.config/resh.toml cp -f config.toml ~/.config/resh.toml
@ -55,10 +55,10 @@ uninstall:
# Uninstalling ... # Uninstalling ...
-rm -rf ~/.resh/ -rm -rf ~/.resh/
resh-daemon: daemon/resh-daemon.go common/resh-common.go resh-daemon: daemon/resh-daemon.go common/resh-common.go version
go build ${GOFLAGS} -o $@ $< go build ${GOFLAGS} -o $@ $<
resh-collect: collect/resh-collect.go common/resh-common.go resh-collect: collect/resh-collect.go common/resh-common.go version
go build ${GOFLAGS} -o $@ $< go build ${GOFLAGS} -o $@ $<

@ -106,14 +106,14 @@ func main() {
if *requireVersion != "" && *requireVersion != Version { if *requireVersion != "" && *requireVersion != Version {
fmt.Println("Please restart/reload this terminal session " + fmt.Println("Please restart/reload this terminal session " +
"(resh version: " + Version + "(resh version: " + Version +
" resh version of this terminal session: " + *requireVersion + "; resh version of this terminal session: " + *requireVersion +
")") ")")
os.Exit(3) os.Exit(3)
} }
if *requireRevision != "" && *requireRevision != Revision { if *requireRevision != "" && *requireRevision != Revision {
fmt.Println("Please restart/reload this terminal session " + fmt.Println("Please restart/reload this terminal session " +
"(resh revision: " + Revision + "(resh revision: " + Revision +
" resh revision of this terminal session: " + *requireRevision + "; resh revision of this terminal session: " + *requireRevision +
")") ")")
os.Exit(3) os.Exit(3)
} }

@ -152,47 +152,53 @@ __resh_precmd() {
__RESH_TZ_AFTER=$(date +%z) __RESH_TZ_AFTER=$(date +%z)
__RESH_PWD_AFTER="$PWD" __RESH_PWD_AFTER="$PWD"
if [ -n "${__RESH_COLLECT}" ]; then if [ -n "${__RESH_COLLECT}" ]; then
resh-collect -requireVersion "$__RESH_VERSION" \ if [ "$__RESH_VERSION" != $(resh-collect -version) ]; then
-requireRevision "$__RESH_REVISION" \ echo "resh WARNING: You probably just updated RESH - please restart/reload this terminal session (resh version: $(resh-collect -version); resh version of this terminal session: ${__RESH_VERSION})"
-cmdLine "$__RESH_CMDLINE" \ elif [ "$__RESH_REVISION" != $(resh-collect -revision) ]; then
-exitCode "$__RESH_EXIT_CODE" \ echo "resh WARNING: You probably just updated RESH - please restart/reload this terminal session (resh version: $(resh-collect -revision); resh version of this terminal session: ${__RESH_REVISION})"
-shell "$__RESH_SHELL" \ else
-uname "$__RESH_UNAME" \ resh-collect -requireVersion "$__RESH_VERSION" \
-sessionId "$__RESH_SESSION_ID" \ -requireRevision "$__RESH_REVISION" \
-cols "$__RESH_COLS" \ -cmdLine "$__RESH_CMDLINE" \
-home "$__RESH_HOME" \ -exitCode "$__RESH_EXIT_CODE" \
-lang "$__RESH_LANG" \ -shell "$__RESH_SHELL" \
-lcAll "$__RESH_LC_ALL" \ -uname "$__RESH_UNAME" \
-lines "$__RESH_LINES" \ -sessionId "$__RESH_SESSION_ID" \
-login "$__RESH_LOGIN" \ -cols "$__RESH_COLS" \
-pwd "$__RESH_PWD" \ -home "$__RESH_HOME" \
-pwdAfter "$__RESH_PWD_AFTER" \ -lang "$__RESH_LANG" \
-shellEnv "$__RESH_SHELL_ENV" \ -lcAll "$__RESH_LC_ALL" \
-term "$__RESH_TERM" \ -lines "$__RESH_LINES" \
-pid "$__RESH_PID" \ -login "$__RESH_LOGIN" \
-sessionPid "$__RESH_SESSION_PID" \ -pwd "$__RESH_PWD" \
-host "$__RESH_HOST" \ -pwdAfter "$__RESH_PWD_AFTER" \
-hosttype "$__RESH_HOSTTYPE" \ -shellEnv "$__RESH_SHELL_ENV" \
-ostype "$__RESH_OSTYPE" \ -term "$__RESH_TERM" \
-machtype "$__RESH_MACHTYPE" \ -pid "$__RESH_PID" \
-shlvl "$__RESH_SHLVL" \ -sessionPid "$__RESH_SESSION_PID" \
-gitCdup "$__RESH_GIT_CDUP" \ -host "$__RESH_HOST" \
-gitCdupExitCode "$__RESH_GIT_CDUP_EXIT_CODE" \ -hosttype "$__RESH_HOSTTYPE" \
-gitRemote "$__RESH_GIT_REMOTE" \ -ostype "$__RESH_OSTYPE" \
-gitRemoteExitCode "$__RESH_GIT_REMOTE_EXIT_CODE" \ -machtype "$__RESH_MACHTYPE" \
-realtimeBefore "$__RESH_RT_BEFORE" \ -shlvl "$__RESH_SHLVL" \
-realtimeAfter "$__RESH_RT_AFTER" \ -gitCdup "$__RESH_GIT_CDUP" \
-realtimeSession "$__RESH_RT_SESSION" \ -gitCdupExitCode "$__RESH_GIT_CDUP_EXIT_CODE" \
-realtimeSessSinceBoot "$__RESH_RT_SESS_SINCE_BOOT" \ -gitRemote "$__RESH_GIT_REMOTE" \
-timezoneBefore "$__RESH_TZ_BEFORE" \ -gitRemoteExitCode "$__RESH_GIT_REMOTE_EXIT_CODE" \
-timezoneAfter "$__RESH_TZ_AFTER" \ -realtimeBefore "$__RESH_RT_BEFORE" \
-osReleaseId "$__RESH_OS_RELEASE_ID" \ -realtimeAfter "$__RESH_RT_AFTER" \
-osReleaseVersionId "$__RESH_OS_RELEASE_VERSION_ID" \ -realtimeSession "$__RESH_RT_SESSION" \
-osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \ -realtimeSessSinceBoot "$__RESH_RT_SESS_SINCE_BOOT" \
-osReleaseName "$__RESH_OS_RELEASE_NAME" \ -timezoneBefore "$__RESH_TZ_BEFORE" \
-osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \ -timezoneAfter "$__RESH_TZ_AFTER" \
&>~/.resh/client_last_run_out.txt || echo "resh ERROR: $(head -n 1 ~/.resh/client_last_run_out.txt)" -osReleaseId "$__RESH_OS_RELEASE_ID" \
# -path "$__RESH_PATH" \ -osReleaseVersionId "$__RESH_OS_RELEASE_VERSION_ID" \
-osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \
-osReleaseName "$__RESH_OS_RELEASE_NAME" \
-osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \
&>~/.resh/client_last_run_out.txt || echo "resh ERROR: $(head -n 1 ~/.resh/client_last_run_out.txt)"
# -path "$__RESH_PATH" \
fi
fi fi
unset __RESH_COLLECT unset __RESH_COLLECT
} }

@ -1 +1 @@
1.1.0 1.1.1

Loading…
Cancel
Save