Skip to content

Commit

Permalink
feat: adding zsh plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Aug 10, 2023
1 parent 6a0f38f commit 7802b09
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dolt.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if (( $+commands[dolt] )); then
# gen-zsh writes a file to the command line, and does not output the completion script like
# most other cli tools. For this reason, we write the file to the local directory and source it
local completion_path=${0:h}/_dolt

if [[ ! -e "$completion_path" ]]; then
# creates a completion file in the current directory
dolt gen-zsh --file="$completion_path"
fi

source "$completion_path"
compdef _dolt dolt
fi

0 comments on commit 7802b09

Please sign in to comment.