refactor: Modify mountpoint check to target /mnt and update test mock to simulate a successful mountpoint.
This commit is contained in:
parent
65cbd16eba
commit
b1f2103631
2 changed files with 6 additions and 5 deletions
|
|
@ -61,7 +61,7 @@ EOF
|
||||||
cat > "$MOCK_BIN/mountpoint" <<EOF
|
cat > "$MOCK_BIN/mountpoint" <<EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "[mountpoint] \$*" >> "$LOG_FILE"
|
echo "[mountpoint] \$*" >> "$LOG_FILE"
|
||||||
return 1 # Simulate not mounted
|
exit 0 # Simulate already mounted
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Mock arch-chroot
|
# Mock arch-chroot
|
||||||
|
|
|
||||||
9
z.sh
9
z.sh
|
|
@ -113,10 +113,11 @@ else
|
||||||
echo "Filesystems created successfully."
|
echo "Filesystems created successfully."
|
||||||
fi
|
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..."
|
if mountpoint -q /mnt; then
|
||||||
umount -R "$seed_device" "$sprout_device" "$efi_device"
|
echo "/mnt is already mounted. Unmounting..."
|
||||||
|
umount -R /mnt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o subvol=/ "$seed_device" /mnt
|
mount -o subvol=/ "$seed_device" /mnt
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue