Skip to content

Commit

Permalink
Write autocomplete script at 'bashgpt config' time
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb26 committed May 5, 2023
1 parent 879d15b commit f22027a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/bashgpt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func configMain(args []string) error {
return fmt.Errorf("Could not write OpenAI API key file %v: %w", keyPath, err)
}

err = checkLatestAutocompleteScript()
if err != nil {
return fmt.Errorf("Could not write autocomplete script: %w", keyPath, err)
}

fmt.Printf("Add the following to your .bashrc or equivalent:\n if [ -f ~/.config/%v/%v ]; then\n . ~/.config/%v/%v\n fi\n",
CommandName, AutocompleteScript, CommandName, AutocompleteScript)

Expand Down

0 comments on commit f22027a

Please sign in to comment.