Use `${PWD}` instead of `$(pwd)`
Don't subshell when there's a shell parameter for it.pull/1927/head
parent
1f6d6aa147
commit
5fc418e479
|
|
@ -227,7 +227,7 @@ EOF
|
||||||
((c++))
|
((c++))
|
||||||
done
|
done
|
||||||
if [ -z "$name" ]; then
|
if [ -z "$name" ]; then
|
||||||
repo=$(basename "$(pwd)")
|
repo="$(basename "${PWD}")"
|
||||||
fi
|
fi
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
-d|-h)
|
-d|-h)
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ _bash-it-restart() {
|
||||||
_about 'restarts the shell in order to fully reload it'
|
_about 'restarts the shell in order to fully reload it'
|
||||||
_group 'lib'
|
_group 'lib'
|
||||||
|
|
||||||
saved_pwd=$(pwd)
|
saved_pwd="${PWD}"
|
||||||
|
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
darwin*)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ alias 8="pushd +8"
|
||||||
alias 9="pushd +9"
|
alias 9="pushd +9"
|
||||||
|
|
||||||
# Clone this location
|
# Clone this location
|
||||||
alias pc="pushd \$(pwd)"
|
alias pc='pushd "${PWD}"'
|
||||||
|
|
||||||
# Push new location
|
# Push new location
|
||||||
alias pu="pushd"
|
alias pu="pushd"
|
||||||
|
|
@ -73,7 +73,7 @@ G () {
|
||||||
example '$ G ..'
|
example '$ G ..'
|
||||||
group 'dirs'
|
group 'dirs'
|
||||||
|
|
||||||
cd "${1:-$(pwd)}" ;
|
cd "${1:-${PWD}}" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
S () {
|
S () {
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ _swd(){
|
||||||
begin="" # The unshortened beginning of the path.
|
begin="" # The unshortened beginning of the path.
|
||||||
shortbegin="" # The shortened beginning of the path.
|
shortbegin="" # The shortened beginning of the path.
|
||||||
current="" # The section of the path we're currently working on.
|
current="" # The section of the path we're currently working on.
|
||||||
end="${2:-$(pwd)}/" # The unmodified rest of the path.
|
end="${2:-${PWD}}/" # The unmodified rest of the path.
|
||||||
|
|
||||||
if [[ "$end" =~ "$HOME" ]]; then
|
if [[ "$end" =~ "$HOME" ]]; then
|
||||||
INHOME=1
|
INHOME=1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue