Skip to content

Commit

Permalink
DRY up the lengthy .tar file name
Browse files Browse the repository at this point in the history
The name of the `.tar` file is repeated multiple times, verbatim. This
not only violates the Don't Repeat Yourself (DRY) principle, it also
makes it easier to miss an instance when the file name changes (as it
did with lycheeverse/lychee#1464).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 12, 2024
1 parent f533887 commit ef72ff8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ runs:
run: |
# Cleanup artifacts from previous run in case it crashed
rm -rf "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz" lychee
curl -sfLO "https://github.com/lycheeverse/lychee/releases/download/${{ inputs.LYCHEEVERSION }}/lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz"
tar -xvzf "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz"
rm "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz"
filename='${{ inputs.LYCHEEVERSION }}/lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz'
curl -sfLO "https://github.com/lycheeverse/lychee/releases/download/${{ inputs.LYCHEEVERSION }}/$filename"
tar -xvzf "$filename"
rm "$filename"
install -t "$HOME/.local/bin" -D lychee
rm lychee
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
Expand Down

0 comments on commit ef72ff8

Please sign in to comment.