Use `$PWD` instead of `\`pwd\``

Don't subshell when there's a shell parameter for it.
pull/1927/head
John D Pell 2021-09-05 17:28:54 -07:00
parent 0dbf1d593c
commit 1f6d6aa147
2 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,8 @@
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g') COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')
__gradle-set-project-root-dir() { __gradle-set-project-root-dir() {
local dir=`pwd` local dir="${PWD}"
project_root_dir=`pwd` project_root_dir="${PWD}"
while [[ $dir != '/' ]]; do while [[ $dir != '/' ]]; do
if [[ -f "$dir/settings.gradle" || -f "$dir/gradlew" ]]; then if [[ -f "$dir/settings.gradle" || -f "$dir/gradlew" ]]; then
project_root_dir=$dir project_root_dir=$dir

View File

@ -86,7 +86,7 @@ S () {
sed "/$@/d" ~/.dirs > ~/.dirs1; sed "/$@/d" ~/.dirs > ~/.dirs1;
\mv ~/.dirs1 ~/.dirs; \mv ~/.dirs1 ~/.dirs;
echo "$@"=\"`pwd`\" >> ~/.dirs; echo "$@"=\""${PWD}"\" >> ~/.dirs;
source ~/.dirs ; source ~/.dirs ;
} }