Wipe current contents when reinstalling.

This commit is contained in:
Anna Rose 2021-08-22 22:25:41 -04:00
parent f91269ecc5
commit 957f6c7d46

View File

@ -1,6 +1,31 @@
parameter BOOT_FILE is "rocket".
clearguis().
copypath("0:/boot/"+BOOT_FILE+".ks", "1:/boot/"+BOOT_FILE+".ks").
switch to 1.
clearguis().
// delete files on current volume
wipeDir("1:/", true).
// copy the new bootloader and execute it.
copypath("0:/boot/"+BOOT_FILE+".ks", "1:/boot/"+BOOT_FILE+".ks").
runpath("/boot/"+BOOT_FILE+".ks").
function wipeDir {
parameter dir, root is false.
cd(dir).
local fileList is list().
list files in fileList.
for f in fileList {
if f:ISFILE {
deletepath(f).
} else if f:NAME[0] <> "." {
wipeDir(f).
}
}
if not root {
cd("..").
}
}