don't quote things when not needed

This commit is contained in:
2012-02-06 21:27:28 +00:00
parent 969e664e63
commit e904c236b4

View File

@@ -38,7 +38,7 @@ path_list () {
# #
path_append () { path_append () {
if [ ! -n "$1" ]; then return 2; fi if [ ! -n "$1" ]; then return 2; fi
path_remove "$1" path_remove $1
export PATH="$PATH:$1" export PATH="$PATH:$1"
} }
@@ -60,7 +60,7 @@ path_append () {
# #
path_prepend () { path_prepend () {
if [ ! -n "$1" ]; then return 2; fi if [ ! -n "$1" ]; then return 2; fi
path_remove "$1" path_remove $1
export PATH="$1:$PATH" export PATH="$1:$PATH"
} }
@@ -107,7 +107,7 @@ path_remove () {
path_add_before () { path_add_before () {
if [ ! -n "$1" ] || [ ! -n "$2" ]; then return 2; fi if [ ! -n "$1" ] || [ ! -n "$2" ]; then return 2; fi
if [[ ":$PATH:" == *":$2:"* ]]; then if [[ ":$PATH:" == *":$2:"* ]]; then
path_remove "$1" path_remove $1
local dirs=":$PATH:" local dirs=":$PATH:"
dirs=${dirs/:$2:/:$1:$2:} dirs=${dirs/:$2:/:$1:$2:}
export PATH=$(__path_clean $dirs) export PATH=$(__path_clean $dirs)
@@ -135,7 +135,7 @@ path_add_before () {
path_add_after () { path_add_after () {
if [ ! -n "$1" ] || [ ! -n "$2" ]; then return 2; fi if [ ! -n "$1" ] || [ ! -n "$2" ]; then return 2; fi
if [[ ":$PATH:" == *":$2:"* ]]; then if [[ ":$PATH:" == *":$2:"* ]]; then
path_remove "$1" path_remove $1
local dirs=":$PATH:" local dirs=":$PATH:"
dirs=${dirs/:$2:/:$2:$1:} dirs=${dirs/:$2:/:$2:$1:}
export PATH=$(__path_clean $dirs) export PATH=$(__path_clean $dirs)