Skip to content

Commit

Permalink
- minor scope fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lhazlewood committed Aug 30, 2023
1 parent 10c7c15 commit dc5c91f
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions impl/src/test/scripts/softhsm
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@

set -Eeuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/

# global vars used across functions
SOFTHSM2_CONF="${SOFTHSM2_CONF:-}"
script_file="${BASH_SOURCE[0]}"
script_dir=
script_name=
user_home=
test_keys_dir=
platform=
libsofthsm2=
globalconf=
userconf=
confdir=
tokendir=

_readlink() {
$(type -p greadlink readlink | head -1) "$1" # prefer greadlink if it exists
}
Expand Down Expand Up @@ -72,6 +58,25 @@ _path() {
echo "$target"
}

# global vars used across functions
SOFTHSM2_CONF="${SOFTHSM2_CONF:-}"
script_file=
script_dir=
script_name=
user_home=
test_keys_dir=
platform=
libsofthsm2=
globalconf=
userconf=
confdir=
tokendir=

script_file="$(_path "${script_file}")" # canonicalize
script_dir="$(dirname "$script_file")"
script_name="$(basename "${script_file}")"
user_home="$(_path "${HOME}")"

_softhsmu() {
softhsm2-util --so-pin 1234 --pin 1234 --token jjwt "$@"
}
Expand Down Expand Up @@ -101,10 +106,6 @@ _setup() {
_errexit "pkcs11-tool command is not available. Install with 'brew install opensc' or 'sudo apt-get -y install opensc'"
fi

script_file="$(_path "${script_file}")" # canonicalize
script_dir="$(dirname "$script_file")"
script_name="$(basename "${script_file}")"
user_home="$(_path "${HOME}")"
test_keys_dir="${script_dir}/../resources/io/jsonwebtoken/impl/security"
test_keys_dir="$(_path ${test_keys_dir})" # canonicalize

Expand Down

0 comments on commit dc5c91f

Please sign in to comment.