Skip to content

Commit

Permalink
Verify run script using shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
tribut committed Jul 20, 2021
1 parent 394db01 commit 41c6765
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
image: koalaman/shellcheck-alpine:stable

shellcheck-run:
stage: test
script:
- shellcheck --version
- shellcheck --color=always ./run
7 changes: 5 additions & 2 deletions run
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash

USER="homeassistant"
GROUP="$USER"
Expand Down Expand Up @@ -56,7 +57,7 @@ if [ -n "${EXTRA_GID:-}" ]; then
supplementary_groups+=( "$group" )
done

bashio::log.info "Appending supplementary groups: ${supplementary_groups[@]}"
bashio::log.info "Appending supplementary groups: ${supplementary_groups[*]}"
for group in "${supplementary_groups[@]}"; do
addgroup "$USER" "$group"
done
Expand Down Expand Up @@ -95,10 +96,12 @@ fi
#

bashio::log.info "Activating venv"
# shellcheck source=/dev/null
. "$VENV_PATH/bin/activate"

bashio::log.info "Setting new \$HOME"
export HOME="$( getent passwd "$USER" | cut -d: -f6 )"
HOME="$( getent passwd "$USER" | cut -d: -f6 )"
export HOME

# Everything below should be kept in sync with upstream's
# https://github.com/home-assistant/core/blob/dev/rootfs/etc/services.d/home-assistant/run
Expand Down

0 comments on commit 41c6765

Please sign in to comment.