şunun yansıması
https://github.com/Hilbis/Hilbish
eşitlendi 2025-07-14 14:52:02 +00:00
feat: add option for fs.mkdir to make recursive
Bu işleme şunda yer alıyor:
ebeveyn
cd06c61195
işleme
fb04322844
@ -47,9 +47,15 @@ func cd(L *lua.LState) int {
|
|||||||
|
|
||||||
func mkdir(L *lua.LState) int {
|
func mkdir(L *lua.LState) int {
|
||||||
dirname := L.CheckString(1)
|
dirname := L.CheckString(1)
|
||||||
|
recursive := L.ToBool(2)
|
||||||
|
path := strings.TrimSpace(dirname)
|
||||||
|
|
||||||
// TODO: handle error here
|
// TODO: handle error here
|
||||||
os.Mkdir(strings.TrimSpace(dirname), 0744)
|
if recursive {
|
||||||
|
os.MkdirAll(path, 0744)
|
||||||
|
} else {
|
||||||
|
os.Mkdir(path, 0744)
|
||||||
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
Yükleniyor…
x
Yeni konuda referans
Bir kullanıcı engelle