Skip to content

Commit

Permalink
fix --new when run without an initial script
Browse files Browse the repository at this point in the history
It was creating a file in the current directory, instead of the ~/sd directory.
  • Loading branch information
ianthehenry committed Dec 5, 2021
1 parent 7cbe902 commit daa4a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sd
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ EOF
chmod +x "$script"

if [[ -z "$body" ]]; then
__sd_edit "${command_path[@]}"
__sd_edit "$script"
fi
}

Expand Down Expand Up @@ -214,7 +214,7 @@ sd() (
__sd_new "$target" "$@"
exit 0
elif [[ "$found_edit" = "true" ]]; then
__sd_edit "$target" "$@"
__sd_edit "$target"
exit 0
elif [[ "$found_cat" = "true" ]]; then
__sd_cat "$target"
Expand Down

0 comments on commit daa4a0e

Please sign in to comment.