summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pm.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/pm.lua b/pm.lua
index 381ff21..bf22cd5 100644
--- a/pm.lua
+++ b/pm.lua
@@ -90,6 +90,11 @@ local function dlfile(filename)
local src=rbase..filename
local dest="/"..filename
print("downloading "..src.." to "..dest)
+ local dir = fs.getDir(dest)
+ if not fs.isDir(dir) then
+ print("creating directory "..dir)
+ fs.makeDir(dir)
+ end
local file,err=fs.open(dest,"w")
if err then error("fs.open "..err) end
local res,err = http.get(src)