1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

standardize to new age shell style

This commit is contained in:
William Ting 2014-01-07 22:13:29 -06:00
parent 4716493681
commit d4f824d79f
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
# set user installation paths # set user installation paths
if [ -d ~/.autojump/ ]; then if [[ -d ~/.autojump/ ]]; then
export PATH=~/.autojump/bin:"${PATH}" export PATH=~/.autojump/bin:"${PATH}"
fi fi
@ -50,7 +50,7 @@ j() {
fi fi
new_path="$(autojump ${@})" new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [[ -d "${new_path}" ]]; then
echo -e "\\033[31m${new_path}\\033[0m" echo -e "\\033[31m${new_path}\\033[0m"
cd "${new_path}" cd "${new_path}"
else else
@ -79,7 +79,7 @@ jo() {
fi fi
new_path="$(autojump ${@})" new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [[ -d "${new_path}" ]]; then
case ${OSTYPE} in case ${OSTYPE} in
linux-gnu) linux-gnu)
xdg-open "${new_path}" xdg-open "${new_path}"

View File

@ -1,6 +1,6 @@
# source autojump on BASH or ZSH depending on the shell # source autojump on BASH or ZSH depending on the shell
shell=`echo ${SHELL} | awk -F/ '{ print $NF }'` shell=$(echo ${SHELL} | awk -F/ '{ print $NF }')
# prevent circular loop for sh shells # prevent circular loop for sh shells
if [ "${shell}" = "sh" ]; then if [ "${shell}" = "sh" ]; then

View File

@ -1,14 +1,14 @@
# set user installation paths # set user installation paths
if [[ -d ${HOME}/.autojump ]]; then if [[ -d ~/.autojump ]]; then
path=(${HOME}/.autojump/bin ${path}) path=(~/.autojump/bin ${path})
fpath=(${HOME}/.autojump/functions/ ${fpath}) fpath=(~/.autojump/functions/ ${fpath})
fi fi
# set homebrew installation paths # set homebrew installation paths
command -v brew &>/dev/null \ if command -v brew && [[ -d "$(brew --prefix)/share/zsh/site-functions" ]]; then
&& [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \ fpath=("$(brew --prefix)/share/zsh/site-functions" ${fpath})
&& fpath=(`brew --prefix`/share/zsh/site-functions ${fpath}) fi
# set error file location # set error file location
@ -38,7 +38,7 @@ j() {
fi fi
local new_path="$(autojump ${@})" local new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [[ -d "${new_path}" ]]; then
echo -e "\\033[31m${new_path}\\033[0m" echo -e "\\033[31m${new_path}\\033[0m"
cd "${new_path}" cd "${new_path}"
else else
@ -67,7 +67,7 @@ jo() {
fi fi
local new_path="$(autojump ${@})" local new_path="$(autojump ${@})"
if [ -d "${new_path}" ]; then if [[ -d "${new_path}" ]]; then
case ${OSTYPE} in case ${OSTYPE} in
linux-gnu) linux-gnu)
xdg-open "${new_path}" xdg-open "${new_path}"