Skip to content

Commit

Permalink
added shell checker
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed May 10, 2022
1 parent f4dac26 commit 23287a9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ShellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Script Check

on:
push:
branches:
- '**'
- '!master-ci'
- '!release'

pull_request:
branches:
- master

workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run Shellcheck
uses: azohra/shell-linter@latest
11 changes: 6 additions & 5 deletions scripts/updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ if [ "$current_version" != "$latest_version" ]; then

echo "Update URL: ${update_url}"

# Get the filename of the latest version.
zip_name=$(curl -H "Authorization: token ${access_token}" -I --location "${update_url}" | grep -o -E 'filename=.*$' | sed -e 's/filename=//')

echo "Zip name: ${zip_name}"

# Download the latest version.
curl -H "Authorization: token ${access_token}" \
--output "/opt/Stem/branch_staging/${latest_version}.zip" \
Expand All @@ -51,8 +46,14 @@ if [ "$current_version" != "$latest_version" ]; then

rm /opt/Stem/branch_staging/"$latest_version".zip

# Rename the extracted directory to the latest version.
mv /opt/Stem/branch_staging/$(ls -N /opt/Stem/branch_staging) /opt/Stem/branch_staging/"$latest_version"

cd /opt/Stem/branch_staging/"$latest_version"

# Run the installer.
./install.sh

else
echo "Branch is up to date."
exit 0
Expand Down

0 comments on commit 23287a9

Please sign in to comment.