override noclobber option

pull/77/head
Simon Let 6 years ago
parent 2ebccfab6a
commit dce959390c
  1. 4
      scripts/hooks.sh
  2. 2
      scripts/reshctl.sh
  3. 6
      scripts/util.sh
  4. 6
      scripts/widgets.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

@ -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

@ -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
}

@ -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

Loading…
Cancel
Save