From bdb16a3e9f1df23fb2522fd75ba8586497e1a046 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 22 Sep 2024 19:52:33 +0200 Subject: [PATCH] Remove unnecessary environment variable --- winiso/deploy.fish | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/winiso/deploy.fish b/winiso/deploy.fish index 997cce3b..3b8a946f 100755 --- a/winiso/deploy.fish +++ b/winiso/deploy.fish @@ -247,18 +247,14 @@ begin "$bootPath" \ "$dataPath" - - if [ ! -b "$WIN_DISK" ] - chooseDisk WIN_DISK - end - - echo "Proceeding will cause the disk `$WIN_DISK` to be wiped." + chooseDisk winDisk + echo "Proceeding will cause the disk `$winDisk` to be wiped." if ! confirm "Are you sure you want to continue?" "n" exit 1 end - sudo shred -vfzn 0 -s 512 "$WIN_DISK" + sudo shred -vfzn 0 -s 512 "$winDisk" begin printf %s\n \ @@ -285,18 +281,13 @@ begin 7 \ \ w - end | sudo fdisk "$WIN_DISK" + end | sudo fdisk "$winDisk" begin set -l disks - - while true - set disks (string split -n " " (bash -c "echo $WIN_DISK*")) - [ (count $disks) -ge 3 ] && break - end - - set -l bootDisk "$disks[2]" - set -l dataDisk "$disks[3]" + set -l diskPath (find -L /dev/disk/by-diskseq -samefile $winDisk) + set -l bootDisk "$diskPath-part1" + set -l dataDisk "$diskPath-part2" sudo mkfs.fat -F 32 -n "BOOT" "$bootDisk" sudo mkfs.ntfs -fFL "$setupLabel" "$dataDisk" sudo mount --mkdir "$bootDisk" "$bootPath"