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-actions "$__RESH_HIST_RECALL_ACTIONS" \
--recall-strategy "$__RESH_HIST_RECALL_STRATEGY" \ --recall-strategy "$__RESH_HIST_RECALL_STRATEGY" \
--recall-last-cmdline "$__RESH_HIST_PREV_LINE" \ --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 # used for collect and collect --recall
@ -166,7 +166,7 @@ __resh_precmd() {
-gitRemoteExitCodeAfter "$__RESH_GIT_REMOTE_EXIT_CODE_AFTER" \ -gitRemoteExitCodeAfter "$__RESH_GIT_REMOTE_EXIT_CODE_AFTER" \
-realtimeAfter "$__RESH_RT_AFTER" \ -realtimeAfter "$__RESH_RT_AFTER" \
-timezoneAfter "$__RESH_TZ_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 fi
__resh_reset_variables __resh_reset_variables
fi fi

@ -120,7 +120,7 @@ resh() {
elif [ $status_code = 130 ]; then elif [ $status_code = 130 ]; then
true true
else else
echo "$buffer" > ~/.resh/cli_last_run_out.txt echo "$buffer" >| ~/.resh/cli_last_run_out.txt
echo "resh-cli ERROR:" echo "resh-cli ERROR:"
cat ~/.resh/cli_last_run_out.txt cat ~/.resh/cli_last_run_out.txt
fi fi

@ -51,9 +51,9 @@ __resh_run_daemon() {
fi fi
if [ "$(uname)" = Darwin ]; then if [ "$(uname)" = Darwin ]; then
# hotfix # 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 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 fi
} }
@ -161,6 +161,6 @@ __resh_session_init() {
-osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \ -osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \
-osReleaseName "$__RESH_OS_RELEASE_NAME" \ -osReleaseName "$__RESH_OS_RELEASE_NAME" \
-osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_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 fi
} }

@ -51,7 +51,7 @@ __resh_widget_arrow_up() {
# run recall # run recall
local NEW_BUFFER local NEW_BUFFER
local status_code 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=$? status_code=$?
# revert histno change on error # revert histno change on error
# shellcheck disable=SC2015 # shellcheck disable=SC2015
@ -80,7 +80,7 @@ __resh_widget_arrow_down() {
else else
# run recall # run recall
local NEW_BUFFER 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 # IF new buffer in non-empty THEN use the new buffer ELSE revert histno change
# shellcheck disable=SC2015 # shellcheck disable=SC2015
[ "${#NEW_BUFFER}" -gt 0 ] && BUFFER=$NEW_BUFFER || (( __RESH_HISTNO++ )) [ "${#NEW_BUFFER}" -gt 0 ] && BUFFER=$NEW_BUFFER || (( __RESH_HISTNO++ ))
@ -115,7 +115,7 @@ __resh_widget_control_R() {
elif [ $status_code = 130 ]; then elif [ $status_code = 130 ]; then
BUFFER="$PREVBUFFER" BUFFER="$PREVBUFFER"
else 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)" echo "# RESH cli failed - sorry for the inconvinience (error output was saved to ~/.resh/cli_last_run_out.txt)"
BUFFER="$PREVBUFFER" BUFFER="$PREVBUFFER"
fi fi

Loading…
Cancel
Save