mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-16 19:36:23 -06:00
feat: adding zsh plugin
This commit is contained in:
13
dolt.plugin.zsh
Normal file
13
dolt.plugin.zsh
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user