Commit 10992c1e authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Move `which` call outside of pydevenv* aliases

parent e0d3f432
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -29,14 +29,14 @@ _venv_make_func() {
	esac
	for python in $(_venv_glob_path "$pattern"|basename_filter|sort -u); do
		version=$(tr -d . <<<"${python#python}")
		alias pydevenv${version}="_venv_enable $version $platform $python"
		alias pydevenv${version}="_venv_enable $version $platform $(which $python)"
	done
}


_venv_enable() {
	local venv=.venv${1}-${2}
	[[ -d "$venv" ]] || virtualenv "$venv" -p$(which ${3})
	local venv=.venv${1}-${2} python=$3
	[[ -d "$venv" ]] || virtualenv "$venv" -p${3}
	[[ -v VIRTUAL_ENV ]] && has deactivate is function && deactivate
	source "$venv/bin/activate"
}