#!/bin/bash
# functions.sh
# Caleb Evans

# Reloads entire shell, including .bash_profile and any activated virtualenv
reload() {
	deactivate 2> /dev/null
	exec $SHELL -l
}

# Makes new Python virtualenv for current directory
mkvirtualenv() {
	local envname="$(basename "$PWD")"
	pushd "$WORKON_HOME" > /dev/null
	virtualenv -p "$1" "$envname"
	popd > /dev/null
	# Activate virtualenv so packages can be installed
	source "$WORKON_HOME/$envname"/bin/activate
}

# Removes existing Python virtualenv
rmvirtualenv() {
	rm -r "$WORKON_HOME"/"$(basename "$PWD")"
}

#!/bin/bash
# functions.sh
# Caleb Evans

# Reloads entire shell, including .bash_profile and any activated virtualenv
reload() {
	deactivate 2> /dev/null
	exec $SHELL -l
}

# Makes new Python virtualenv for current directory
mkvirtualenv() {
	local envname="$(basename "$PWD")"
	pushd "$WORKON_HOME" > /dev/null
	virtualenv -p "$1" "$envname"
	popd > /dev/null
	# Activate virtualenv so packages can be installed
	source "$WORKON_HOME/$envname"/bin/activate
}

# Removes existing Python virtualenv
rmvirtualenv() {
	rm -r "$WORKON_HOME"/"$(basename "$PWD")"
}

# Flushes all DNS caches for OS X 10.10.4 and onward
flushdns() {
	sudo dscacheutil -flushcache
	sudo killall -HUP mDNSResponder
}

Add Bash function to flush DNS caches
Add Bash function to flush DNS caches
