fix: Remove usage of $(pwd) in favor of $PWD

This commit is contained in:
Edwin Kofler 2022-12-27 05:33:59 -08:00
parent 2478510b91
commit f522ab9879
No known key found for this signature in database
GPG Key ID: A1E60C1F1A423B08
9 changed files with 15 additions and 15 deletions

View File

@ -10,7 +10,7 @@ plugin_current_command() {
check_if_plugin_exists "$plugin_name"
local search_path
search_path=$(pwd)
search_path=$PWD
local version_and_path
version_and_path=$(find_versions "$plugin_name" "$search_path")
local full_version

View File

@ -42,7 +42,7 @@ display_installed_versions() {
fi
if [ -n "${versions}" ]; then
current_version=$(cut -d '|' -f 1 <<<"$(find_versions "$plugin_name" "$(pwd)")")
current_version=$(cut -d '|' -f 1 <<<"$(find_versions "$plugin_name" "$PWD")")
for version in $versions; do
flag=" "

View File

@ -39,7 +39,7 @@ get_concurrency() {
install_one_local_tool() {
local plugin_name=$1
local search_path
search_path=$(pwd)
search_path=$PWD
local plugin_versions
@ -65,7 +65,7 @@ install_local_tool_versions() {
plugins_path=$(get_plugin_path)
local search_path
search_path=$(pwd)
search_path=$PWD
local some_tools_installed
local some_plugin_not_installed

View File

@ -24,7 +24,7 @@ version_command() {
elif [ "$cmd" = "local-tree" ]; then
file=$(find_tool_versions)
else # cmd = local
file="$(pwd)/$file_name"
file="$PWD/$file_name"
fi
if [ -L "$file" ]; then

View File

@ -347,7 +347,7 @@ parse_legacy_version_file() {
get_preset_version_for() {
local plugin_name=$1
local search_path
search_path=$(pwd)
search_path=$PWD
local version_and_path
version_and_path=$(find_versions "$plugin_name" "$search_path")
local version
@ -451,7 +451,7 @@ find_tool_versions() {
find_file_upwards() {
local name="$1"
local search_path
search_path=$(pwd)
search_path=$PWD
while [ "$search_path" != "/" ]; do
if [ -f "$search_path/$name" ]; then
printf "%s\n" "${search_path}/$name"
@ -706,7 +706,7 @@ select_version() {
# These are separated by a space. e.g. python 3.7.2 2.7.15
# For each plugin/version pair, we check if it is present in the shim
local search_path
search_path=$(pwd)
search_path=$PWD
local shim_versions
IFS=$'\n' read -rd '' -a shim_versions <<<"$(get_shim_versions "$shim_name")"

View File

@ -101,7 +101,7 @@ cleaned_path() {
@test "function calls asdf command" {
result=$(elvish -norc -c "
set-env ASDF_DIR $(pwd)
set-env ASDF_DIR $(pwd) # checkstyle-ignore
set paths = [$(cleaned_path)]
use asdftest _asdf; var asdf~ = \$_asdf:asdf~
asdf info

View File

@ -71,7 +71,7 @@ cleaned_path() {
@test "function calls asdf command" {
result=$(fish -c "
set -e asdf
set -x ASDF_DIR $(pwd)
set -x ASDF_DIR $(pwd) # checkstyle-ignore
set PATH $(cleaned_path)
. asdf.fish

View File

@ -89,7 +89,7 @@ cleaned_path() {
@test "function calls asdf command" {
result=$(
unset -f asdf
ASDF_DIR=$(pwd)
ASDF_DIR=$PWD
PATH=$(cleaned_path)
source_asdf_sh

View File

@ -351,11 +351,11 @@ teardown() {
@test "resolve_symlink converts the symlink path to the real file path" {
touch foo
ln -s $(pwd)/foo bar
ln -s $PWD/foo bar
run resolve_symlink bar
[ "$status" -eq 0 ]
[ "$output" = $(pwd)/foo ]
[ "$output" = $PWD/foo ]
rm -f foo bar
}
@ -365,7 +365,7 @@ teardown() {
run resolve_symlink baz/bar
[ "$status" -eq 0 ]
[ "$output" = $(pwd)/baz/../foo ]
[ "$output" = $PWD/baz/../foo ]
rm -f foo bar
}
@ -375,7 +375,7 @@ teardown() {
run resolve_symlink bar
[ "$status" -eq 0 ]
[ "$output" = $(pwd)/foo ]
[ "$output" = $PWD/foo ]
rm -f foo bar
}