2
0

Fix globs

This commit is contained in:
Madis Mägi 2021-03-01 08:25:04 +02:00
parent a0a29e931c
commit 2f60dbafea

View File

@ -71,7 +71,7 @@ case $BUTTERKNIFE_TRANSFER_METHOD in
echo -e "n\np\n\n\n\nw" | fdisk $BUTTERKNIFE_DISK
;;
resize)
NTFS_PARTITION=$(ls $BUTTERKNIFE_DISK? | tail -n 1)
NTFS_PARTITION=$(ls $BUTTERKNIFE_DISK?* | tail -n 1)
# TODO: Assert last one is NTFS
# TODO: Suggested size heuristics
MINSIZE=$(ntfsresize $NTFS_PARTITION -m | grep Minsize | cut -d ':' -f 2)
@ -113,7 +113,7 @@ case $BUTTERKNIFE_TRANSFER_METHOD in
case $BUTTERKNIFE_PARTITIONING_METHOD in
reformat|receive)
# Dialog to select partition for reformat or receive
for partition in $BUTTERKNIFE_DISK?; do
for partition in $BUTTERKNIFE_DISK?*; do
partition_slug=$(echo $BUTTERKNIFE_PARTITION | cut -d "/" -f 3)
sector_count=$(cat /sys/block/$bk_disk_slug/$BUTTERKNIFE_PARTITION_slug/size)
sector_size=$(cat /sys/block/$bk_disk_slug/queue/hw_sector_size)
@ -132,7 +132,7 @@ case $BUTTERKNIFE_TRANSFER_METHOD in
;;
unpartitioned|resize|mbr|gpt|efi)
# Assume last partition
BUTTERKNIFE_PARTITION=$(ls $BUTTERKNIFE_DISK? | tail -n 1)
BUTTERKNIFE_PARTITION=$(ls $BUTTERKNIFE_DISK?* | tail -n 1)
;;
*)
echo "Invalid partitioning method $BUTTERKNIFE_PARTITIONING_METHOD"