Add completions integration to workstation env
This commit is contained in:
		@@ -6,10 +6,11 @@ if [ -f `which powerline-daemon` ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export NVM_DIR="$HOME/.nvm"
 | 
					export NVM_DIR="$HOME/.nvm"
 | 
				
			||||||
 | 
					export PROJECTS_DIR="$HOME/Documents/projects"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function gg() {
 | 
					function gg() {
 | 
				
			||||||
  cd ~/Git/$1;
 | 
					  cd "$PROJECTS_DIR/$1";
 | 
				
			||||||
  if [ -f ~/Git/$1/pyproject.toml ]; then
 | 
					  if [ -f "$PROJECTS_DIR/$1/pyproject.toml" ]; then
 | 
				
			||||||
    poetry shell;
 | 
					    poetry shell;
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,23 @@
 | 
				
			|||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
  loop: "{{ _local_human_users }}"
 | 
					  loop: "{{ _local_human_users }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Configure bash completions
 | 
				
			||||||
 | 
					  become: true
 | 
				
			||||||
 | 
					  ansible.builtin.blockinfile:
 | 
				
			||||||
 | 
					    path: ~{{ item.0 }}/.config/bash_completions
 | 
				
			||||||
 | 
					    create: true
 | 
				
			||||||
 | 
					    block: >-
 | 
				
			||||||
 | 
					      function _gg_completion() {
 | 
				
			||||||
 | 
					          local cur=${COMP_WORDS[COMP_CWORD]};
 | 
				
			||||||
 | 
					          COMPREPLY=( $(compgen -W "$(command ls $PROJECT_DIR)" -- $cur) );
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      complete -F _gg_completion gg
 | 
				
			||||||
 | 
					    owner: "{{ ansible_user }}"
 | 
				
			||||||
 | 
					    group: "{{ item.0 }}"
 | 
				
			||||||
 | 
					    mode: 0664
 | 
				
			||||||
 | 
					  loop: "{{ _local_human_users }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Enforce ownership of the SSH keys
 | 
					- name: Enforce ownership of the SSH keys
 | 
				
			||||||
  become: true
 | 
					  become: true
 | 
				
			||||||
  ansible.builtin.file:
 | 
					  ansible.builtin.file:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user