mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 17:43:05 +02:00
- Move all linux_configuration scripts into two semantic categories: - single_use/: scripts run once manually (fresh install, fixes, setup) - periodic_background/: scripts run by systemd timers or daemons - Preserve existing subdirectory structure within each category - Fix lib/common.sh source paths for new directory depths - Fix CONFIG_DIR depth in setup_periodic_system.sh and check_and_enable_services.sh - Update all references in tests, fresh-install/main.sh, nix modules, and docs - Fix check_polling_antipatterns.sh false positives (||, regex |, case patterns, jq strings) - Fix pre-existing mypy exclusion path and type annotations for moved tools/ directory - Rewrite check_polling_antipatterns.sh using awk (no bash regex loops); add require_serial: true
42 lines
762 B
Bash
Executable File
42 lines
762 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Simple test script to debug file removal
|
|
|
|
set -euo pipefail
|
|
|
|
DOWNLOADS_DIR="$HOME/Downloads"
|
|
|
|
# Test function
|
|
test_file_removal() {
|
|
local files=()
|
|
|
|
# Find a few test files
|
|
while IFS= read -r -d '' file; do
|
|
files+=("$file")
|
|
done < <(find "$DOWNLOADS_DIR" -name "*.jpg" -print0 2>/dev/null | head -z -n 2)
|
|
|
|
echo "Found ${#files[@]} test files:"
|
|
for file in "${files[@]}"; do
|
|
echo " - $file"
|
|
done
|
|
|
|
echo "Attempting to remove files..."
|
|
local removed=0
|
|
local failed=0
|
|
|
|
for file in "${files[@]}"; do
|
|
echo "Removing: $file"
|
|
if rm "$file" 2>/dev/null; then
|
|
echo " SUCCESS"
|
|
((removed++))
|
|
else
|
|
echo " FAILED (exit code: $?)"
|
|
((failed++))
|
|
fi
|
|
done
|
|
|
|
echo "Results: $removed removed, $failed failed"
|
|
}
|
|
|
|
test_file_removal
|