Skip to content

Commit

Permalink
Merge pull request #8 from wistia/mew/bugfix_prefix_postfix_inputs
Browse files Browse the repository at this point in the history
fix: ensure prefix & postfix inputs work correctly
  • Loading branch information
okize authored Feb 27, 2024
2 parents 27dca79 + 2b10446 commit 8506fad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: "postfix applied after the tool version name (eg. _tool_version)"
required: false
filename:
description: ".tool-versions filename. default .tool-versions"
description: ".tool-versions filename. default is `.tool-versions`"
required: false
default: '.tool-versions'

Expand All @@ -30,9 +30,9 @@ runs:
while IFS= read -r line; do
if [[ $line != \#* ]]; then
NAME="$(echo $line | cut -d' ' -f1)"
if [ "${{inputs.name_position}}" == "prefix" ]; then
if [ -n "${{inputs.prefix}}" ]; then
NAME="${{inputs.prefix}}$NAME"
elif [ "${{inputs.name_position}}" == "postfix" ]; then
elif [ -n "${{inputs.postfix}}" ]; then
NAME="$NAME${{inputs.postfix}}"
fi
if [ "${{inputs.uppercase}}" == "true" ]; then NAME="$(echo $NAME | tr [:lower:] [:upper:])"; fi
Expand Down

0 comments on commit 8506fad

Please sign in to comment.