From dce959390c693539310f4d5794f8cf25b1045155 Mon Sep 17 00:00:00 2001 From: Simon Let Date: Fri, 24 Jan 2020 14:22:40 +0100 Subject: [PATCH] override noclobber option --- scripts/hooks.sh | 4 ++-- scripts/reshctl.sh | 2 +- scripts/util.sh | 6 +++--- scripts/widgets.sh | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/hooks.sh b/scripts/hooks.sh index 2ed626e..b0fd1ce 100644 --- a/scripts/hooks.sh +++ b/scripts/hooks.sh @@ -19,7 +19,7 @@ __resh_preexec() { --recall-actions "$__RESH_HIST_RECALL_ACTIONS" \ --recall-strategy "$__RESH_HIST_RECALL_STRATEGY" \ --recall-last-cmdline "$__RESH_HIST_PREV_LINE" \ - > ~/.resh/collect_last_run_out.txt 2>&1 || echo "resh-collect ERROR: $(head -n 1 ~/.resh/collect_last_run_out.txt)" + >| ~/.resh/collect_last_run_out.txt 2>&1 || echo "resh-collect ERROR: $(head -n 1 ~/.resh/collect_last_run_out.txt)" } # used for collect and collect --recall @@ -166,7 +166,7 @@ __resh_precmd() { -gitRemoteExitCodeAfter "$__RESH_GIT_REMOTE_EXIT_CODE_AFTER" \ -realtimeAfter "$__RESH_RT_AFTER" \ -timezoneAfter "$__RESH_TZ_AFTER" \ - > ~/.resh/postcollect_last_run_out.txt 2>&1 || echo "resh-postcollect ERROR: $(head -n 1 ~/.resh/postcollect_last_run_out.txt)" + >| ~/.resh/postcollect_last_run_out.txt 2>&1 || echo "resh-postcollect ERROR: $(head -n 1 ~/.resh/postcollect_last_run_out.txt)" fi __resh_reset_variables fi diff --git a/scripts/reshctl.sh b/scripts/reshctl.sh index 794c478..95aa0e5 100644 --- a/scripts/reshctl.sh +++ b/scripts/reshctl.sh @@ -120,7 +120,7 @@ resh() { elif [ $status_code = 130 ]; then true else - echo "$buffer" > ~/.resh/cli_last_run_out.txt + echo "$buffer" >| ~/.resh/cli_last_run_out.txt echo "resh-cli ERROR:" cat ~/.resh/cli_last_run_out.txt fi diff --git a/scripts/util.sh b/scripts/util.sh index c2db69b..cfbe3f9 100644 --- a/scripts/util.sh +++ b/scripts/util.sh @@ -51,9 +51,9 @@ __resh_run_daemon() { fi if [ "$(uname)" = Darwin ]; then # hotfix - gnohup resh-daemon > ~/.resh/daemon_last_run_out.txt 2>&1 & disown + gnohup resh-daemon >| ~/.resh/daemon_last_run_out.txt 2>&1 & disown else - setsid resh-daemon > ~/.resh/daemon_last_run_out.txt 2>&1 & disown + setsid resh-daemon >| ~/.resh/daemon_last_run_out.txt 2>&1 & disown fi } @@ -161,6 +161,6 @@ __resh_session_init() { -osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \ -osReleaseName "$__RESH_OS_RELEASE_NAME" \ -osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \ - > ~/.resh/session_init_last_run_out.txt 2>&1 || echo "resh-session-init ERROR: $(head -n 1 ~/.resh/session_init_last_run_out.txt)" + >| ~/.resh/session_init_last_run_out.txt 2>&1 || echo "resh-session-init ERROR: $(head -n 1 ~/.resh/session_init_last_run_out.txt)" fi } diff --git a/scripts/widgets.sh b/scripts/widgets.sh index 68a2266..638e189 100644 --- a/scripts/widgets.sh +++ b/scripts/widgets.sh @@ -51,7 +51,7 @@ __resh_widget_arrow_up() { # run recall local NEW_BUFFER local status_code - NEW_BUFFER="$(__resh_collect --recall --prefix-search "$__RESH_PREFIX" 2> ~/.resh/arrow_up_last_run_out.txt)" + NEW_BUFFER="$(__resh_collect --recall --prefix-search "$__RESH_PREFIX" 2>| ~/.resh/arrow_up_last_run_out.txt)" status_code=$? # revert histno change on error # shellcheck disable=SC2015 @@ -80,7 +80,7 @@ __resh_widget_arrow_down() { else # run recall local NEW_BUFFER - NEW_BUFFER="$(__resh_collect --recall --prefix-search "$__RESH_PREFIX" 2> ~/.resh/arrow_down_last_run_out.txt)" + NEW_BUFFER="$(__resh_collect --recall --prefix-search "$__RESH_PREFIX" 2>| ~/.resh/arrow_down_last_run_out.txt)" # IF new buffer in non-empty THEN use the new buffer ELSE revert histno change # shellcheck disable=SC2015 [ "${#NEW_BUFFER}" -gt 0 ] && BUFFER=$NEW_BUFFER || (( __RESH_HISTNO++ )) @@ -115,7 +115,7 @@ __resh_widget_control_R() { elif [ $status_code = 130 ]; then BUFFER="$PREVBUFFER" else - echo "$BUFFER" > ~/.resh/cli_last_run_out.txt + echo "$BUFFER" >| ~/.resh/cli_last_run_out.txt echo "# RESH cli failed - sorry for the inconvinience (error output was saved to ~/.resh/cli_last_run_out.txt)" BUFFER="$PREVBUFFER" fi