Compare commits

..

1 commit

Author SHA1 Message Date
ZoopaMario aaf9ecfc1d Refactor code to make linter runs succeed
All checks were successful
Lint Bash Scripts / lint-bash (push) Successful in 28s
Check Commit Messages / check-commit-message (pull_request) Successful in 14s
Lint Bash Scripts / lint-bash (pull_request) Successful in 21s
This commit refactors the codebase in order to make the shellcheck
workflow pass.
2024-12-29 15:40:33 +01:00
2 changed files with 18 additions and 5 deletions

View file

@ -18,15 +18,27 @@ jobs:
- name: Checkout Code
uses: https://code.forgejo.org/actions/checkout@v4
with:
fetch-depth: 0 # Fetch the entire history to avoid REST API reliance
fetch-depth: 0
- name: Install ShellCheck
run: |
apt-get update && apt-get install -y shellcheck
- name: Lint Bash Scripts
- name: Find Shell Scripts
id: find-scripts
run: |
echo "Linting Bash scripts..."
find . -name '*.sh' -print0 | xargs -0 shellcheck -x --exclude=SC1091 --exclude=SC2015
echo "Searching for shell scripts..."
find . -name '*.sh' -print0 > shell-scripts.list
- name: Run ShellCheck in Script Directories
run: |
echo "Running ShellCheck in each script's directory..."
while IFS= read -r -d '' script; do
echo "Checking $script"
script_dir=$(dirname "$script")
script_name=$(basename "$script")
# Change to the script's directory and run ShellCheck
(cd "$script_dir" && shellcheck -x "$script_name")
done < shell-scripts.list

View file

@ -24,6 +24,7 @@ while getopts ":f:h:u:p:m:b:" opt; do
done
# Create a temporary file for the encrypted archive
# shellcheck disable=SC2015
TMP_FILENAME=duplicati_db-$(date +"%Y%m%d").bak &&
TMP_FILEPATH="$SCRIPT_ABS_LOCATION" || { log "Error: Failed to create a temporary file."; exit 1; }