View difference between Paste ID: jJnc1xkc and Pj9LQzfE
SHOW: | | - or go back to the newest paste.
1
term.setBackgroundColor(colors.black)
2
term.clear()
3
term.setCursorPos(1,1)
4
print("Are you sure? [Y/N] ")
5
6
local event, key = os.pullEvent("key")
7
if key == keys.y then
8
	os.unloadAPI(_G)
9
	for i, v in ipairs(fs.list('/')) do
10-
		fs.delete('/'..v)
10+
                if v ~= "rom" then
11-
		print("/"..v.." was deleted.")
11+
		    fs.delete('/'..v)
12
		    print("/"..v.." was deleted.")
13
                end
14
	end
15
	os.reboot()
16
elseif key == keys.n then
17
	print("Format cancelled.")
18
	return
19
else
20
	print("Invalid key")
21
	print("Format cancelled.")
22
end