Initializer script checks tmux version

This commit is contained in:
Bruno Sutic 2015-02-12 03:37:34 +01:00
parent a53b6a10e6
commit 099cc256f3
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
4 changed files with 11 additions and 8 deletions

View File

@ -4,3 +4,4 @@
- first working version - first working version
- run the save script in the background - run the save script in the background
- do not start saving right after tmux is started - do not start saving right after tmux is started
- add a check for tmux version to the initializer script

View File

@ -15,9 +15,11 @@ add_resurrect_save_interpolation() {
} }
main() { main() {
if supported_tmux_version_ok; then
# Don't start saving right after tmux is started. # Don't start saving right after tmux is started.
# We wanna give user a chance to restore previous session. # We wanna give user a chance to restore previous session.
set_last_save_timestamp set_last_save_timestamp
add_resurrect_save_interpolation add_resurrect_save_interpolation
fi
} }
main main

View File

@ -6,10 +6,6 @@ source "$CURRENT_DIR/helpers.sh"
source "$CURRENT_DIR/variables.sh" source "$CURRENT_DIR/variables.sh"
source "$CURRENT_DIR/shared.sh" source "$CURRENT_DIR/shared.sh"
supported_tmux_version_ok() {
$CURRENT_DIR/check_tmux_version.sh "$SUPPORTED_VERSION"
}
enough_time_since_last_run_passed() { enough_time_since_last_run_passed() {
local last_saved_timestamp="$(get_tmux_option "$last_auto_save_option" "0")" local last_saved_timestamp="$(get_tmux_option "$last_auto_save_option" "0")"
local interval_minutes="$(get_tmux_option "$auto_save_interval_option" "$auto_save_interval_default")" local interval_minutes="$(get_tmux_option "$auto_save_interval_option" "$auto_save_interval_default")"

View File

@ -5,3 +5,7 @@ current_timestamp() {
set_last_save_timestamp() { set_last_save_timestamp() {
set_tmux_option "$last_auto_save_option" "$(current_timestamp)" set_tmux_option "$last_auto_save_option" "$(current_timestamp)"
} }
supported_tmux_version_ok() {
$CURRENT_DIR/check_tmux_version.sh "$SUPPORTED_VERSION"
}