Compare commits

..

1 commit

Author SHA1 Message Date
ZoopaMario eb1e69b49c Refactor code to make linter runs succeed
Some checks failed
Lint Bash Scripts / lint-bash (push) Failing after 27s
Check Commit Messages / check-commit-message (pull_request) Successful in 15s
Lint Bash Scripts / lint-bash (pull_request) Failing after 22s
This commit refactors the codebase in order to make the shellcheck
workflow pass.
2024-12-29 15:57:54 +01:00
3 changed files with 15 additions and 5 deletions

View file

@ -24,12 +24,23 @@ jobs:
run: | run: |
apt-get update && apt-get install -y shellcheck apt-get update && apt-get install -y shellcheck
- name: Run ShellCheck - name: Find Shell Scripts
shell: bash id: find-scripts
run: | run: |
echo "Searching for shell scripts..." echo "Searching for shell scripts..."
find . -name '*.sh' -print0 > shell-scripts.list find . -name '*.sh' > shell-scripts.list
echo "Found the following scripts:"
cat shell-scripts.list
- name: Run ShellCheck in Script Directories
shell: bash
run: |
echo "Running ShellCheck in each script's directory..." echo "Running ShellCheck in each script's directory..."
if [ ! -s shell-scripts.list ]; then
echo "No shell scripts found."
exit 0
fi
while IFS= read -r script; do while IFS= read -r script; do
echo "Checking $script" echo "Checking $script"
script_dir=$(dirname "$script") script_dir=$(dirname "$script")

View file

@ -1 +0,0 @@
New file invalid

View file

@ -9,7 +9,7 @@ BACKUP_CONTAINER="duplicati"
SOURCE_DIR="/mnt/data/vaultwarden" SOURCE_DIR="/mnt/data/vaultwarden"
# Dump Database # Dump Database
log "Dumping vaultwarden database..." log "Dumping vaultwarden database..."
DB_TMP_BAK_NAME=vaultwarden-db_$(date +"%Y%m%d").sqlite3 DB_TMP_BAK_NAME=vaultwarden-db_$(date +"%Y%m%d").sqlite3
sqlite3 "$SOURCE_DIR/db.sqlite3 .backup '$SOURCE_DIR/$DB_TMP_BAK_NAME'" || { log "Error: Failed to dump the Nextcloud database."; exit 1; } sqlite3 "$SOURCE_DIR/db.sqlite3 .backup '$SOURCE_DIR/$DB_TMP_BAK_NAME'" || { log "Error: Failed to dump the Nextcloud database."; exit 1; }