From b1f21036312f73db40ed6f4e6e1afd840676bcb4 Mon Sep 17 00:00:00 2001 From: Zeev Diukman Date: Sun, 18 Jan 2026 08:55:22 +0200 Subject: [PATCH] refactor: Modify mountpoint check to target `/mnt` and update test mock to simulate a successful mountpoint. --- test_z.sh | 2 +- z.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test_z.sh b/test_z.sh index 9c868c6..6e4f6d0 100644 --- a/test_z.sh +++ b/test_z.sh @@ -61,7 +61,7 @@ EOF cat > "$MOCK_BIN/mountpoint" <> "$LOG_FILE" -return 1 # Simulate not mounted +exit 0 # Simulate already mounted EOF # Mock arch-chroot diff --git a/z.sh b/z.sh index 02c54ed..273d812 100755 --- a/z.sh +++ b/z.sh @@ -113,10 +113,11 @@ else echo "Filesystems created successfully." fi -# check if any of the devices is mounted -if mountpoint -q "$seed_device" || mountpoint -q "$sprout_device" || mountpoint -q "$efi_device"; then - echo "One or more devices are already mounted. Unmounting..." - umount -R "$seed_device" "$sprout_device" "$efi_device" + + +if mountpoint -q /mnt; then + echo "/mnt is already mounted. Unmounting..." + umount -R /mnt fi mount -o subvol=/ "$seed_device" /mnt