Small import.lua fixes

* Make override check more clear by giving var and method a different
name
 * Fix typo in input canceled message
This commit is contained in:
ToMe25
2022-06-29 16:51:40 +02:00
parent c55e8dc9eb
commit 32c770fe3a

View File

@@ -17,7 +17,7 @@ end
local function error_handler(err)
if err:match("import was canceled$") then
io.stderr:write("Import was calceled by the user.\n")
io.stderr:write("Import was canceled by the user.\n")
else
io.stderr:write(debug.traceback(err, 2))
io.stderr:write("\n")
@@ -60,8 +60,8 @@ end
while file_exists(name) do
io.write("File '" .. name .. "' exists. ")
local is_dir = is_dir(name)
if not is_dir then
local dir = is_dir(name)
if not dir then
io.write("[O]verwrite/")
end
@@ -74,7 +74,7 @@ while file_exists(name) do
io.write("Enter new name: ")
io.flush()
name = io.read()
elseif not is_dir and (choice == "o" or choice == "O") then
elseif not dir and (choice == "o" or choice == "O") then
break
else
io.stderr:write("Invalid option: " .. choice .. "\n")