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
|
||||
#!/bin/bash
|
||||
echo "[mountpoint] \$*" >> "$LOG_FILE"
|
||||
return 1 # Simulate not mounted
|
||||
exit 0 # Simulate already mounted
|
||||
EOF
|
||||
|
||||
# Mock arch-chroot
|
||||
|
|
|
|||
9
z.sh
9
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue