forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow players to send in bug reports (opentibiabr#1666)
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FS = {} | ||
|
||
function FS.exists(path) | ||
local file = io.open(path, "r") | ||
if file then | ||
file:close() | ||
return true | ||
end | ||
return false | ||
end | ||
|
||
function FS.mkdir(path) | ||
if FS.exists(path) then | ||
return true | ||
end | ||
local success, err = os.execute("mkdir " .. path) | ||
if not success then | ||
return false, err | ||
end | ||
return true | ||
end | ||
|
||
function FS.mkdir_p(path) | ||
if path == "" then | ||
return true | ||
end | ||
if FS.exists(path) then | ||
return true | ||
end | ||
FS.mkdir_p(path:match("(.*[/\\])")) | ||
return FS.mkdir(path) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters