mirror of
				https://github.com/wting/autojump
				synced 2025-06-13 12:54:07 +00:00 
			
		
		
		
	standardize to new age shell style
This commit is contained in:
		
							parent
							
								
									4716493681
								
							
						
					
					
						commit
						d4f824d79f
					
				@ -1,5 +1,5 @@
 | 
			
		||||
# set user installation paths
 | 
			
		||||
if [ -d ~/.autojump/ ]; then
 | 
			
		||||
if [[ -d ~/.autojump/ ]]; then
 | 
			
		||||
    export PATH=~/.autojump/bin:"${PATH}"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
@ -50,7 +50,7 @@ j() {
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    new_path="$(autojump ${@})"
 | 
			
		||||
    if [ -d "${new_path}" ]; then
 | 
			
		||||
    if [[ -d "${new_path}" ]]; then
 | 
			
		||||
        echo -e "\\033[31m${new_path}\\033[0m"
 | 
			
		||||
        cd "${new_path}"
 | 
			
		||||
    else
 | 
			
		||||
@ -79,7 +79,7 @@ jo() {
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    new_path="$(autojump ${@})"
 | 
			
		||||
    if [ -d "${new_path}" ]; then
 | 
			
		||||
    if [[ -d "${new_path}" ]]; then
 | 
			
		||||
        case ${OSTYPE} in
 | 
			
		||||
            linux-gnu)
 | 
			
		||||
                xdg-open "${new_path}"
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
# 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
 | 
			
		||||
if [ "${shell}" = "sh" ]; then
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,14 @@
 | 
			
		||||
# set user installation paths
 | 
			
		||||
if [[ -d ${HOME}/.autojump ]]; then
 | 
			
		||||
    path=(${HOME}/.autojump/bin ${path})
 | 
			
		||||
    fpath=(${HOME}/.autojump/functions/ ${fpath})
 | 
			
		||||
if [[ -d ~/.autojump ]]; then
 | 
			
		||||
    path=(~/.autojump/bin ${path})
 | 
			
		||||
    fpath=(~/.autojump/functions/ ${fpath})
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# set homebrew installation paths
 | 
			
		||||
command -v brew &>/dev/null \
 | 
			
		||||
    && [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \
 | 
			
		||||
    && fpath=(`brew --prefix`/share/zsh/site-functions ${fpath})
 | 
			
		||||
if command -v brew && [[ -d "$(brew --prefix)/share/zsh/site-functions" ]]; then
 | 
			
		||||
    fpath=("$(brew --prefix)/share/zsh/site-functions" ${fpath})
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# set error file location
 | 
			
		||||
@ -38,7 +38,7 @@ j() {
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    local new_path="$(autojump ${@})"
 | 
			
		||||
    if [ -d "${new_path}" ]; then
 | 
			
		||||
    if [[ -d "${new_path}" ]]; then
 | 
			
		||||
        echo -e "\\033[31m${new_path}\\033[0m"
 | 
			
		||||
        cd "${new_path}"
 | 
			
		||||
    else
 | 
			
		||||
@ -67,7 +67,7 @@ jo() {
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    local new_path="$(autojump ${@})"
 | 
			
		||||
    if [ -d "${new_path}" ]; then
 | 
			
		||||
    if [[ -d "${new_path}" ]]; then
 | 
			
		||||
        case ${OSTYPE} in
 | 
			
		||||
            linux-gnu)
 | 
			
		||||
                xdg-open "${new_path}"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user