Skip to content

Commit

Permalink
Fix shellcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
safing-bot committed Mar 1, 2023
1 parent fa75e3d commit 757bcca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
# SC1091: Ignore included files that cannot be found.
# SC2181: Ignore exit code style.
SHELLCHECK_OPTS: -e SC1091 -e SC2181
with:
ignore_paths: windows linux/templates linux/tests

Expand Down
14 changes: 7 additions & 7 deletions linux/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -- $(getopt -u -o uhd:t: -l no-color,no-download,purge,uninstall,no-upgrade,debug,help,assets-url:,start-url:,arch:,tmp-dir: -n 'portmaster-installer' -- "$@")
set -- "$(getopt -u -o uhd:t: -l no-color,no-download,purge,uninstall,no-upgrade,debug,help,assets-url:,start-url:,arch:,tmp-dir: -n 'portmaster-installer' -- "$@")"

if [[ $? -ne 0 ]]; then
exit 1
Expand Down Expand Up @@ -164,12 +164,12 @@ download_pmstart() {
copy_icons() {
local failure=0
for res in /opt/safing/portmaster/icons/* ; do
cp $res/* "/usr/share/icons/hicolor/$(basename $res)" >/dev/null 2>&1 || failure=1
cp "$res"/* "/usr/share/icons/hicolor/$(basename "$res")" >/dev/null 2>&1 || failure=1

if [[ $failure -ne 0 ]]; then
break
fi
echo "/usr/share/icons/hicolor/$(basename $res)" >> /opt/safing/portmaster/.installed-files
echo "/usr/share/icons/hicolor/$(basename "$res")" >> /opt/safing/portmaster/.installed-files
done

if [[ $failure -ne 0 ]]; then
Expand Down Expand Up @@ -201,8 +201,8 @@ install_or_upgrade() {
assets="${tmp_dir}/assets.tar.gz"
pmstart="${tmp_dir}/portmaster-start"

download_assets $assets
download_pmstart $pmstart
download_assets "$assets"
download_pmstart "$pmstart"

if [[ "${upgrade}" != "yes" ]]; then
log info "Creating /opt/safing/portmaster"
Expand All @@ -215,7 +215,7 @@ install_or_upgrade() {
# Untar the archive on root
log info "Extracting assets to /opt/safing/portmaster"
tar --extract --no-same-owner --no-same-permissions --no-overwrite-dir -m --file="${assets}"
cp ${pmstart} /opt/safing/portmaster/portmaster-start
cp "${pmstart}" /opt/safing/portmaster/portmaster-start
chmod 0755 /opt/safing/portmaster/portmaster-start

log success "Extracted assets to /opt/safing/portmaster"
Expand Down Expand Up @@ -274,7 +274,7 @@ remove() {
pre_remove "$1"

# for the next steps we need to switch to the system root
cat .installed-files | xargs rm -v 2>/dev/null >&2
xargs rm -v 2>/dev/null >&2 <.installed-files
log success "Installed files deleted"

log info "Running post-remove scripts ..."
Expand Down
8 changes: 4 additions & 4 deletions linux/release_to_aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
source tests/common.sh

if [ ! -e ./PKGBUILD ]; then
error 'Run `make gen-pkgbuild` first'
error "Run first: make gen-pkgbuild"
exit 1
fi

if [ -z $GITHUB_COMMIT_MESSAGE ]; then
if [ -z "$GITHUB_COMMIT_MESSAGE" ]; then
error "No commit message defined in GITHUB_COMMIT_MESSAGE"
exit 1
fi
Expand All @@ -33,7 +33,7 @@ group "Copying files to AUR repository"
endgroup

cd "${target}"
if [[ `git status --porcelain` ]]; then
if [[ $(git status --porcelain) ]]; then
# we only generate a new .SRCINFO file if we have actual changes to the AUR repo
# that we want to publish.
group "Generating .SRCINFO"
Expand All @@ -48,4 +48,4 @@ if [[ `git status --porcelain` ]]; then
endgroup
else
info "No changes detected, aborting"
fi
fi

0 comments on commit 757bcca

Please sign in to comment.