Skip to content

Commit

Permalink
Add check for poetry version
Browse files Browse the repository at this point in the history
  • Loading branch information
connortann committed Feb 10, 2022
1 parent 3aac574 commit c237473
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,26 @@ runs:
$poetry_ config virtualenvs.in-project ${{ inputs.virtualenvs-in-project }}
$poetry_ config virtualenvs.path ${{ inputs.virtualenvs-path }}
# Install plugins from whitespace or commas-delimited list
# Parse plugins from whitespace or commas-delimited list
plugins=(`echo "${{ inputs.plugins }}" | tr ',' ' '`)
for plugin in "${plugins[@]}"
do
echo "Installing plugin: $plugin"
$poetry_ plugin add $plugin
done
if [ ${#plugins[@]} -gt 0 ]; then
# Ensure poetry version >= 1.2
version=${{ inputs.version }}
major=${version:0:1}
minor=${version:2:1}
if [ $major -lt 1 ] || [ $minor -lt 2 ]; then
echo "Use of plugins requires Poetry version >= 1.2"
exit 1
fi
# Install plugins
for plugin in "${plugins[@]}"
do
echo "Installing plugin: $plugin"
$poetry_ plugin add $plugin
done
fi
config="$($poetry_ config --list)"
Expand Down

0 comments on commit c237473

Please sign in to comment.