viasite-ansible / ansible-role-zsh

Setup antigen with oh-my-zsh, powerlevel10k theme, fzf, autosuggestions, syntax-highlighting
https://habrahabr.ru/post/323496/
MIT License
347 stars 85 forks source link

'antigen bundle [' in ~/.zshrc #63

Closed NickVolynkin closed 1 year ago

NickVolynkin commented 2 years ago

Just deployed this playbook on a new machine. Got this in my ~/.zshrc:

...
source "$HOME/.antigen/antigen/antigen.zsh"

antigen use oh-my-zsh

antigen bundle [
antigen bundle {
antigen bundle '
antigen bundle n
antigen bundle a
antigen bundle m
antigen bundle e
antigen bundle '
antigen bundle :
antigen bundle
antigen bundle '
antigen bundle c
antigen bundle o
antigen bundle m
antigen bundle m
antigen bundle a
antigen bundle n
antigen bundle d
antigen bundle -
antigen bundle n
antigen bundle o
antigen bundle t
antigen bundle -
antigen bundle f
antigen bundle o
antigen bundle u
antigen bundle n
antigen bundle d
antigen bundle '
...

Looks like a big data structure is witten one letter at a line.

$ cat ~/.zshrc | grep 'antigen bundle' | sed 's/antigen bundle //g' | awk '{printf $0}'
[{'name': 'command-not-found', 'when': False}, {'name': 'brew', 'command': 'brew'}, {'name': 'docker', 'command': 'docker'}, {'name': 'docker-compose', 'command': 'docker-compose'}, 'fancy-ctrl-z', 'git-extras', 'gnu-utils', {'name': 'httpie', 'command': 'http'}, {'name': 'golang', 'command': 'go'}, {'name': 'gulp', 'command': 'gulp'}, {'name': 'helm', 'command': 'helm'}, {'name': 'kubectl', 'command': 'kubectl'}, {'name': 'pip', 'command': 'pip'}, {'name': 'rake', 'command': 'rake'}, {'name': 'symfony2', 'command': 'symfony'}, {'name': 'systemd', 'command': 'systemctl'}, 'python', {'name': 'tmux', 'command': 'tmux'}, {'name': 'vagrant', 'command': 'vagrant'}, {'name': 'viasite/server-scripts', 'command': 'dbdump'}, {'name': 'zsh-users/zsh-autosuggestions', 'when': True}, 'popstas/zsh-command-time', {'name': 'unixorn/autoupdate-antigen.zshplugin', 'when': True}, 'urbainvaes/fzf-marks', 'ytet5uy4/fzf-widgets', {'name': 'zdharma-continuum/fast-syntax-highlighting', 'when': True}] + ['nvm']% 

$ ansible --version                                        
ansible [core 2.13.1]
  config file = None
  configured module search path = ['/Users/nick/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/6.1.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/nick/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.10.5 (main, Jun 23 2022, 17:07:30) [Clang 13.0.0 (clang-1300.0.29.30)]
  jinja version = 3.1.2
  libyaml = True

$  ansible-galaxy list
# /Users/nick/.ansible/roles
- viasite-ansible.zsh, v3.5.2
quantumfate commented 2 years ago

I am currently working on this. The issue is that there are too many nested dictionaries. So the first loop iterates the outer dict and the second one the characters of the inner dicht including [ , { etc. I managed to fix it for list items that are not a mapping (e.g. items listed with a bare hyphen). I am currently making a few changes to redesign how the data is stored to make it simpler to iterate.

quantumfate commented 2 years ago

I fixed this with my pull request.

rparree commented 1 year ago

Any reason why hasn't this been merged yet?

popstas commented 1 year ago

Sorry, guys, I've ignored this project for a long time, going to merge all the PRs, thank you!

Personally, I'm still using ansible 2.10, so this issue was not affected me.