diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2022-07-29 00:20:01 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-08-26 11:53:15 -0300 |
commit | 6ea9a85d6589a6c890ff0e136ab88703567aa983 (patch) | |
tree | e2621a22ce2d501ca58a37efa466abf3e886bcae | |
parent | 6441053b53b77f9d96891b71d5e8b431e84bfb04 (diff) | |
download | luarocks-6ea9a85d6589a6c890ff0e136ab88703567aa983.tar.gz luarocks-6ea9a85d6589a6c890ff0e136ab88703567aa983.tar.bz2 luarocks-6ea9a85d6589a6c890ff0e136ab88703567aa983.zip |
persist: create directory for file to be saved
-rw-r--r-- | src/luarocks/persist.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua index 02c5016c..4dcd930a 100644 --- a/src/luarocks/persist.lua +++ b/src/luarocks/persist.lua | |||
@@ -188,6 +188,8 @@ end | |||
188 | -- @return boolean or (nil, string): true if successful, or nil and a | 188 | -- @return boolean or (nil, string): true if successful, or nil and a |
189 | -- message in case of errors. | 189 | -- message in case of errors. |
190 | function persist.save_from_table(filename, tbl, field_order) | 190 | function persist.save_from_table(filename, tbl, field_order) |
191 | local prefix = dir.dir_name(filename) | ||
192 | fs.make_dir(prefix) | ||
191 | local out = io.open(filename, "w") | 193 | local out = io.open(filename, "w") |
192 | if not out then | 194 | if not out then |
193 | return nil, "Cannot create file at "..filename | 195 | return nil, "Cannot create file at "..filename |