Skip to content

Instantly share code, notes, and snippets.

@rxw1
Last active August 29, 2015 13:56
Show Gist options
  • Save rxw1/9063780 to your computer and use it in GitHub Desktop.
Save rxw1/9063780 to your computer and use it in GitHub Desktop.
Wrapper script for wu to switch to different locations
#!/usr/bin/env zsh
# https://github.com/sramsay/wu/issues/28
# array containing our ~/.condrc suffixes (e.g. ~/.condrc.tokyo)
a=($(ls -1 ~/.condrc.* | awk -F. '{print $NF}'))
# check if our array contains the first given argument
if [[ ${a[(r)$1]} == $1 ]]; then
loc=$1; shift
ln -sf ~/.condrc.$loc ~/.condrc
fi
wu $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment