Skip to content

Instantly share code, notes, and snippets.

@rpedde
Last active December 29, 2015 01:19
Show Gist options
  • Save rpedde/7591961 to your computer and use it in GitHub Desktop.
Save rpedde/7591961 to your computer and use it in GitHub Desktop.
ubernova
#!/bin/bash
_ubernova() {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(pushd ${HOME}/.ubernova > /dev/null 2>&1; ls *; popd > /dev/null 2>&1)" -- $cur) )
}
ubernova() {
local env=${1}
if [ ! -e ${HOME}/.ubernova/${env} ]; then
return 1
fi
source ${HOME}/.ubernova/${env}
}
complete -F _ubernova ubernova
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment