mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 23:05:08 +00:00
fix: move logs to ~/Library/Logs/mole, add system idle assets cleanup
- Move log files from ~/.config/mole/ to ~/Library/Logs/mole/ per
macOS convention. Fixes #569.
- Add safe_sudo_find_delete for /Library/Application Support/
com.apple.idleassetsd/Customer/ screensaver videos. Closes #570.
- Update tests to reflect new log file paths.
This commit is contained in:
@@ -50,7 +50,7 @@ setup() {
|
||||
stdout_output="$(HOME="$HOME" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; log_info '$message'")"
|
||||
[[ "$stdout_output" == *"$message"* ]]
|
||||
|
||||
local log_file="$HOME/.config/mole/mole.log"
|
||||
local log_file="$HOME/Library/Logs/mole/mole.log"
|
||||
[[ -f "$log_file" ]]
|
||||
grep -q "INFO: $message" "$log_file"
|
||||
}
|
||||
@@ -64,13 +64,13 @@ setup() {
|
||||
[[ -s "$stderr_file" ]]
|
||||
grep -q "$message" "$stderr_file"
|
||||
|
||||
local log_file="$HOME/.config/mole/mole.log"
|
||||
local log_file="$HOME/Library/Logs/mole/mole.log"
|
||||
[[ -f "$log_file" ]]
|
||||
grep -q "ERROR: $message" "$log_file"
|
||||
}
|
||||
|
||||
@test "rotate_log_once only checks log size once per session" {
|
||||
local log_file="$HOME/.config/mole/mole.log"
|
||||
local log_file="$HOME/Library/Logs/mole/mole.log"
|
||||
mkdir -p "$(dirname "$log_file")"
|
||||
dd if=/dev/zero of="$log_file" bs=1024 count=1100 2> /dev/null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user