Skip to content

Commit

Permalink
fix: use protocPlugins "none" default
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Nov 23, 2020
1 parent 8b348cc commit 75b1e1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
required: false
protocPlugins:
description: The protoc language plugins to install, space separated. See README for supported plugins.
default: " "
default: "none"
required: false

runs:
Expand Down
20 changes: 11 additions & 9 deletions scripts/install-buf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ source scripts/executor-info.sh

BUF_VERSION=$1

IFS=" " read -r -a PROTOC_PLUGINS <<< "$2"
for part in "${PROTOC_PLUGINS[@]}"; do
IFS="@" read -r -a langAndVersion <<< "$part"
if [ "$2" != "none" ]; then
IFS=" " read -r -a PROTOC_PLUGINS <<<"$2"
for part in "${PROTOC_PLUGINS[@]}"; do
IFS="@" read -r -a langAndVersion <<<"$part"

if [ "${#langAndVersion[@]}" != 2 ]; then
echo "Malformed plugin specifier \"$part\", expected e.g. [email protected]"
exit 1
fi
if [ "${#langAndVersion[@]}" != 2 ]; then
echo "Malformed plugin specifier \"$part\", expected e.g. [email protected]"
exit 1
fi

bash "scripts/install-${langAndVersion[0]}-plugin.sh" "${langAndVersion[1]}"
done
bash "scripts/install-${langAndVersion[0]}-plugin.sh" "${langAndVersion[1]}"
done
fi

if [ ! -f ".bin/buf" ]; then
echo "Installing buf $BUF_VERSION for OS $UNAME_OS Arch $UNAME_ARCH"
Expand Down

0 comments on commit 75b1e1b

Please sign in to comment.