summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-05-21 12:22:16 +0300
committerKhaled Hosny <khaledhosny@eglug.org>2010-05-21 15:51:33 +0300
commit0efe73f78ea5bb9f4f546ac2df8a6eca1a80d6c5 (patch)
treef2e878f32e75013777c371e76f3b977bfe07c7bf
parent3cbef76101d9aaef3b2c355c58675bf9f386d949 (diff)
downloadluaotfload-0efe73f78ea5bb9f4f546ac2df8a6eca1a80d6c5.tar.gz
If save directory doesn't exist, create it
-rw-r--r--otfl-font-nms.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 5333c2e..aecdc0b 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -696,8 +696,12 @@ local function update_names(fontnames, force)
end
local function save_names(fontnames)
- local savepath = names.path.localdir .. names.path.basename
- io.savedata(savepath, table.serialize(fontnames, true))
+ local savepath = names.path.localdir
+ if not lfs.isdir(savepath) then
+ dir.mkdirs(savepath)
+ end
+ io.savedata(savepath .. names.path.basename,
+ table.serialize(fontnames, true))
end
names.scan = scan_dir