Files
self-healing-autopoietic-shell/contrib/fx/sources.d/50-thefuck.sh
T

10 lines
406 B
Bash
Raw Normal View History

#!/bin/sh
# thefuck bridge: only fires if thefuck is installed. Note that thefuck
# --yes decides *and executes* its own suggestion, so by the time this
# candidate is shown it may have already run once via thefuck -- treat
# it as informational, not a dry-run.
command -v thefuck >/dev/null 2>&1 || exit 0
cmd="$1"
[ -n "$cmd" ] || exit 0
thefuck --yes "$cmd" 2>/dev/null | tr -d '\342\200\213' | tail -1