Ask for confirmation when creating win usb
This commit is contained in:
parent
33758298cf
commit
dfb347eb3a
|
@ -4,6 +4,7 @@ begin
|
|||
set -l $varName
|
||||
set -l dir (status dirname)
|
||||
source "$dir/lib/choose-disk.fish"
|
||||
source "$dir/lib/confirm.fish"
|
||||
set $varName (bash -c ". $(string escape $dir)/.env; echo \$$varName" 2> /dev/null)
|
||||
|
||||
[ ! -z "$$varName" ]
|
||||
|
@ -251,6 +252,12 @@ begin
|
|||
chooseDisk WIN_DISK
|
||||
end
|
||||
|
||||
echo "Proceeding will cause the disk `$WIN_DISK` to be wiped."
|
||||
|
||||
if ! confirm "Are you sure you want to continue?" "n"
|
||||
exit 1
|
||||
end
|
||||
|
||||
sudo shred -vfzn 0 -s 512 "$WIN_DISK"
|
||||
|
||||
begin
|
||||
|
|
4
winiso/lib/confirm.fish
Executable file
4
winiso/lib/confirm.fish
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/env fish
|
||||
function confirm -a message default
|
||||
fish "$(status dirname)/../../lib/modules/partition/confirm.fish" $argv
|
||||
end
|
Loading…
Reference in a new issue