Skip to content

Commit

Permalink
cleanup var
Browse files Browse the repository at this point in the history
  • Loading branch information
avindra committed Jan 22, 2021
1 parent 9bde789 commit 0f4abcc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ if [[ $? -eq 0 ]]; then
fi
function dir() {
response=$(dirp $@)
stdout=$(dirp $@)
status=$?
if [[ -n $response ]]; then
if [[ -n $stdout ]]; then
if [[ $status -eq 2 ]]; then
$EDITOR "$response"
$EDITOR "$stdout"
return $?
fi
echo "Switching to $response... "
pushd "$response"
echo "Switching to $stdout... "
pushd "$stdout"
fi
}
Expand All @@ -31,19 +31,19 @@ function dir() {
// PrintHook emits shell code for Fish
func PrintHook() {
fmt.Println(`function dir
set response (dirp $argv)
set stdout (dirp $argv)
if [ $status = 2 ]
$EDITOR "$response"
$EDITOR "$stdout"
return $status
end
if [ "x$response" = "x" ]
if [ "x$stdout" = "x" ]
echo -n "How are we doing @ "
uptime
return $status
end
echo "Switching to $response"
pushd "$selection"

This comment has been minimized.

Copy link
@avindra

avindra Jan 22, 2021

Author Owner

Here was my bug. I renamed selection to response and forgot to change this instance. The new name (stdout) should be clearer and is applied consistently.

echo "Switching to $stdout"
pushd "$stdout"
end`)
}

0 comments on commit 0f4abcc

Please sign in to comment.