Skip to content

Commit ab5de59

Browse files
committed
Adjusted setup script to improve command execution and cache removal logic. Added checks for AUR helper presence before executing commands and updated logging for better clarity. Adjusted indentation for consistency.
1 parent 1c6077e commit ab5de59

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Thank you for contributing to Pacsea! Please read CONTRIBUTING.md before submitting. -->
1+
<!-- Thank you for contributing to Hyprland-Simple-Setup! Please read CONTRIBUTING.md before submitting. -->
22

33
## Summary
44
Briefly describe the problem and how your change solves it.
@@ -25,7 +25,7 @@ List exact steps and commands to verify the change. Include flags like `--dry-ru
2525
cargo fmt --all
2626
cargo clippy --all-targets --all-features -- -D warnings
2727
cargo test -- --test-threads=1
28-
RUST_LOG=pacsea=debug cargo run -- --dry-run
28+
RUST_LOG=hyprland_setup_tui=debug cargo run -- --dry-run
2929
```
3030

3131
## Screenshots / recordings (if UI changes)

setup.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ update_arch_mirrors() {
12691269
fi
12701270
return 0
12711271
fi
1272-
if ! command -v reflector &> /dev/null; then
1272+
if ! command -v reflector &> /dev/null; then
12731273
print_message "Reflector not installed. Installing reflector..."
12741274
if ! distro_install "reflector"; then
12751275
print_error "Reflector installation failed. Aborting mirror update."
@@ -1295,7 +1295,7 @@ update_pacman() {
12951295
update_yay() {
12961296
announce_step "Updating AUR packages"
12971297
check_yay
1298-
if execute_command "$AUR_HELPER -Sua --noconfirm" "Update AUR packages"; then
1298+
if [ -n "$AUR_HELPER" ] && execute_command "$AUR_HELPER -Sua --noconfirm" "Update AUR packages"; then
12991299
aur_updates+=("AUR Packages: $CHECK_MARK")
13001300
else
13011301
aur_updates+=("AUR Packages: $CROSS_MARK")
@@ -1306,11 +1306,20 @@ remove_cache() {
13061306
announce_step "Removing pacman cache"
13071307
check_yay
13081308
if [[ "$DISTRO" == "endeavouros" ]]; then
1309-
execute_command "sudo paccache -r && sudo pacman -Sc --noconfirm && $AUR_HELPER -Sc --noconfirm" "Remove pacman/aur cache (EndeavourOS)"
1309+
execute_command "sudo paccache -r && sudo pacman -Sc --noconfirm" "Remove pacman cache (EndeavourOS)"
1310+
if [ -n "$AUR_HELPER" ]; then
1311+
execute_command "$AUR_HELPER -Sc --noconfirm" "Remove AUR cache (EndeavourOS)"
1312+
fi
13101313
elif [[ "$DISTRO" == "arch" ]] || [[ "$DISTRO" == "cachyos" ]]; then
1311-
execute_command "sudo pacman -Sc --noconfirm && $AUR_HELPER -Sc --noconfirm" "Remove pacman/aur cache (Arch Linux/CachyOS)"
1314+
execute_command "sudo pacman -Sc --noconfirm" "Remove pacman cache (Arch Linux/CachyOS)"
1315+
if [ -n "$AUR_HELPER" ]; then
1316+
execute_command "$AUR_HELPER -Sc --noconfirm" "Remove AUR cache (Arch Linux/CachyOS)"
1317+
fi
13121318
else
1313-
execute_command "sudo pacman -Sc --noconfirm && $AUR_HELPER -Sc --noconfirm" "Remove pacman/aur cache"
1319+
execute_command "sudo pacman -Sc --noconfirm" "Remove pacman cache"
1320+
if [ -n "$AUR_HELPER" ]; then
1321+
execute_command "$AUR_HELPER -Sc --noconfirm" "Remove AUR cache"
1322+
fi
13141323
fi
13151324
print_message "Pacman cache removed."
13161325
}

0 commit comments

Comments
 (0)