Skip to content

Commit

Permalink
Merge pull request #1927 from gaelicWizard/pwd
Browse files Browse the repository at this point in the history
Use `$PWD` instead of `$(pwd)`
  • Loading branch information
Noah Gorny committed Sep 19, 2021
2 parents 0dbf1d5 + 8d1e802 commit 77e9404
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions completion/available/gradle.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')

__gradle-set-project-root-dir() {
local dir=`pwd`
project_root_dir=`pwd`
local dir="${PWD}"
project_root_dir="${PWD}"
while [[ $dir != '/' ]]; do
if [[ -f "$dir/settings.gradle" || -f "$dir/gradlew" ]]; then
project_root_dir=$dir
Expand Down
2 changes: 1 addition & 1 deletion completion/available/hub.completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ EOF
((c++))
done
if [ -z "$name" ]; then
repo=$(basename "$(pwd)")
repo="$(basename "${PWD}")"
fi
case "$prev" in
-d|-h)
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ _bash-it-restart() {
_about 'restarts the shell in order to fully reload it'
_group 'lib'

saved_pwd=$(pwd)
saved_pwd="${PWD}"

case $OSTYPE in
darwin*)
Expand Down
6 changes: 3 additions & 3 deletions plugins/available/dirs.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ alias 8="pushd +8"
alias 9="pushd +9"

# Clone this location
alias pc="pushd \$(pwd)"
alias pc='pushd "${PWD}"'

# Push new location
alias pu="pushd"
Expand Down Expand Up @@ -73,7 +73,7 @@ G () {
example '$ G ..'
group 'dirs'

cd "${1:-$(pwd)}" ;
cd "${1:-${PWD}}" ;
}

S () {
Expand All @@ -86,7 +86,7 @@ S () {

sed "/$@/d" ~/.dirs > ~/.dirs1;
\mv ~/.dirs1 ~/.dirs;
echo "$@"=\"`pwd`\" >> ~/.dirs;
echo "$@"=\""${PWD}"\" >> ~/.dirs;
source ~/.dirs ;
}

Expand Down
2 changes: 1 addition & 1 deletion test/plugins/base.plugin.bats
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ load ../../plugins/available/base.plugin
mkcd "${dir_name}"
assert_success
assert_dir_exist "${BASH_IT_ROOT}/${dir_name}"
assert_equal $(pwd) "${BASH_IT_ROOT}/${dir_name}"
assert_equal "${PWD}" "${BASH_IT_ROOT}/${dir_name}"
}

@test 'plugins base: lsgrep()' {
Expand Down
2 changes: 1 addition & 1 deletion test/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ git submodule init && git submodule update

if [ -z "${BASH_IT}" ]; then
declare BASH_IT
BASH_IT=$(cd ${test_directory} && dirname "$(pwd)")
BASH_IT="$(cd "${test_directory}" && dirname "${PWD}")"
export BASH_IT
fi

Expand Down
2 changes: 1 addition & 1 deletion themes/powerturk/powerturk.theme.bash
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ _swd(){
begin="" # The unshortened beginning of the path.
shortbegin="" # The shortened beginning of the path.
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
INHOME=1
Expand Down

0 comments on commit 77e9404

Please sign in to comment.