AndreasAugustin / go-gitmoji-cli

:octocat: A conventional gitmoji commit interactive command line tool for using emojis on conventional commits. :rocket:
https://gitmoji.dev/
MIT License
8 stars 0 forks source link

[Bug]: tab tab completion does not work #34

Closed AndreasAugustin closed 1 year ago

AndreasAugustin commented 1 year ago

Is there an existing issue for this?

Describe the bug

Currently the generated completion contains invalid characters

☁  ~  go-gitmoji-cli completion zsh                  
____ ____    ____ _ ___ _  _ ____  _ _    ____ _    _
| __ |  | __ | __ |  |  |\/| |  |  | | __ |    |    |
|__] |__|    |__] |  |  |  | |__| _| |    |___ |___ |
#compdef go-gitmoji-cli
compdef _go-gitmoji-cli go-gitmoji-cli

# zsh completion for go-gitmoji-cli                       -*- shell-script -*-

__go-gitmoji-cli_debug()
{
    local file="$BASH_COMP_DEBUG_FILE"

The figlet is breaking the functionality

Expected Behavior

completions must work

Current Behavior

The generated completion does not work

Steps To Reproduce

☁  ~  go-gitmoji-cli completion zsh > /tmp/completion 
☁  ~  source /tmp/completion                           
/tmp/completion:1: bad pattern: ^[[35m____

Possible Solution

Currently the figlet is created within the root init() function. Somehow when caling go-gitmoji-cli completion zsh the figlet must not be called

Additional Information/Context

No response

go-gitmoji-cli Version

v0.1.0-alpha