Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shellcheck and CI for install script #440

Merged
merged 41 commits into from
Mar 26, 2022
Merged

Shellcheck and CI for install script #440

merged 41 commits into from
Mar 26, 2022

Conversation

Amet13
Copy link
Contributor

@Amet13 Amet13 commented Mar 26, 2022

Description

  • Bump release for heroku deployment
  • CI for install.sh with shellcheck
  • Fix warnings from shellcheck in install.sh

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • macOS and Ubuntu works with shellcheck action
  • As shellcheck action doesn't work in Windows it's in separated job with excluding errors related to SC1017:
^-- SC1017 (error): Literal carriage return. Run script through tr -d '\r' .

Logs

Before:

$ shellcheck install.sh 

In install.sh line 35:
BROWSER_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/${REPO}/releases/latest | grep "${INSTALL_VERSION}" | grep -Eo 'https://[^\"]*')
                                                            ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
BROWSER_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/"${REPO}"/releases/latest | grep "${INSTALL_VERSION}" | grep -Eo 'https://[^\"]*')


In install.sh line 36:
CHECKSUM_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/${REPO}/releases/latest | grep "checksums" | grep -Eo 'https://[^\"]*')
                                                             ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
CHECKSUM_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/"${REPO}"/releases/latest | grep "checksums" | grep -Eo 'https://[^\"]*')


In install.sh line 42:
echo $BROWSER_DOWNLOAD_URL | xargs -n 1 curl -s -L -O
     ^-------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
echo "$BROWSER_DOWNLOAD_URL" | xargs -n 1 curl -s -L -O


In install.sh line 44:
echo $CHECKSUM_DOWNLOAD_URL | xargs -n 1 curl -s -L -O
     ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
echo "$CHECKSUM_DOWNLOAD_URL" | xargs -n 1 curl -s -L -O


In install.sh line 60:
  SHA256SUM=$(${SHA256_BINARY} ${SHA256_SUFFIX} ${ARCHIVE})
                               ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  SHA256SUM=$(${SHA256_BINARY} "${SHA256_SUFFIX}" "${ARCHIVE}")


In install.sh line 61:
  if ! grep -q ${SHA256SUM} "$CHECKSUMS_FILE"; then
               ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
  if ! grep -q "${SHA256SUM}" "$CHECKSUMS_FILE"; then

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

After:

$ shellcheck install.sh               
$ 

Screenshots

See CI results

@Amet13 Amet13 requested a review from arriven as a code owner March 26, 2022 16:24
@arriven arriven merged commit c7f48fe into arriven:main Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants