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

install shellcheck into ~/.local/lib and fix description in sh #227

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:

<!-- auto-generated, do not modify here but in src/ci/install-shellspec.sh.doc -->
```bash
# run the install-shellcheck.sh in your github/gitlab workflow
# run the install-shellspec in your github/gitlab workflow
# for instance, assuming you fetched this file via gt and remote name is tegonal-scripts
# then in a github workflow you would have

Expand Down
30 changes: 22 additions & 8 deletions src/ci/install-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# Version: v4.3.0-SNAPSHOT
####### Description #############
#
# function which searches for *.sh files within defined paths (directories or a single *.sh) and
# runs shellcheck on each file with predefined settings i.a. sets `-s bash`
# installs shellcheck v0.10.0 into $HOME/.local/lib
#
####### Usage ###################
#
Expand All @@ -35,12 +34,27 @@ declare currentDir
currentDir=$(pwd)
tmpDir=$(mktemp -d -t download-shellcheck-XXXXXXXXXX)
cd "$tmpDir"
echo "6c881ab0698e4e6ea235245f22832860544f17ba386442fe7e9d629f8cbedf87 ./shellcheck-v0.10.0.linux.x86_64.tar.xz" >shellcheck-v0.10.0.linux.x86_64.tar.xz.sha256
wget --no-verbose https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz
sha256sum -c shellcheck-v0.10.0.linux.x86_64.tar.xz.sha256
tar -xf ./shellcheck-v0.10.0.linux.x86_64.tar.xz
chmod +x ./shellcheck-v0.10.0/shellcheck
shellcheckVersion="v0.10.0"
echo "6c881ab0698e4e6ea235245f22832860544f17ba386442fe7e9d629f8cbedf87 ./shellcheck-$shellcheckVersion.linux.x86_64.tar.xz" >"shellcheck-$shellcheckVersion.linux.x86_64.tar.xz.sha256"
wget --no-verbose "https://github.com/koalaman/shellcheck/releases/download/$shellcheckVersion/shellcheck-$shellcheckVersion.linux.x86_64.tar.xz"
sha256sum -c "shellcheck-$shellcheckVersion.linux.x86_64.tar.xz.sha256"
tar -xf "./shellcheck-$shellcheckVersion.linux.x86_64.tar.xz"
chmod +x "./shellcheck-$shellcheckVersion/shellcheck"
mkdir -p "$HOME/.local/bin"
ln -s "$tmpDir/shellcheck-v0.10.0/shellcheck" "$HOME/.local/bin/shellcheck"
shellcheckInTmp="$tmpDir/shellcheck-$shellcheckVersion"
shellcheckInHomeLocalLib="$HOME/.local/lib/shellcheck-$shellcheckVersion"
shellcheckBin="$HOME/.local/bin/shellcheck"
if [[ -d "$shellcheckInHomeLocalLib" ]]; then
echo "going to remove the existing installation in $shellcheckInHomeLocalLib"
rm -r "$shellcheckInHomeLocalLib"
else
mkdir -p "$HOME/.local/lib"
fi
mv "$shellcheckInTmp" "$shellcheckInHomeLocalLib"
if [[ -f "$shellcheckBin" ]]; then
rm "$shellcheckBin"
fi
ln -s "$shellcheckInHomeLocalLib/shellcheck" "$shellcheckBin"

cd "$currentDir"
shellcheck --version
2 changes: 1 addition & 1 deletion src/ci/install-shellspec.doc.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# run the install-shellcheck.sh in your github/gitlab workflow
# run the install-shellspec in your github/gitlab workflow
# for instance, assuming you fetched this file via gt and remote name is tegonal-scripts
# then in a github workflow you would have

Expand Down
5 changes: 2 additions & 3 deletions src/ci/install-shellspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
# Version: v4.3.0-SNAPSHOT
####### Description #############
#
# function which searches for *.sh files within defined paths (directories or a single *.sh) and
# runs shellcheck on each file with predefined settings i.a. sets `-s bash`
# installs shellspec 0.28.1 into $HOME/.local/lib
#
####### Usage ###################
#
# # run the install-shellcheck.sh in your github/gitlab workflow
# # run the install-shellspec in your github/gitlab workflow
# # for instance, assuming you fetched this file via gt and remote name is tegonal-scripts
# # then in a github workflow you would have
#
Expand Down
Loading