diff --git a/.github/workflows/ShellCheck.yml b/.github/workflows/ShellCheck.yml new file mode 100644 index 0000000..125edce --- /dev/null +++ b/.github/workflows/ShellCheck.yml @@ -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 diff --git a/scripts/updater.sh b/scripts/updater.sh index 7795628..88c39d8 100755 --- a/scripts/updater.sh +++ b/scripts/updater.sh @@ -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" \ @@ -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