Create static directories at build, not runtime.

Instead of calling lfs.mkdir() to create "./history" and "./screenshots"
at runtime it is easier to create them at package build time.
I hesitated whether to add "./clipboard" to this list but decided
against it as we can perhaps change current directory and then
all the code manipulating clipboard would break, so I left it as is.
Tigran Aivazian 12 years ago
parent ba1e739543
commit 385f74222a

@ -216,7 +216,7 @@ customupdate: all
$(STRIP) --strip-unneeded kpdfview
-rm kindlepdfviewer-$(VERSION).zip
rm -Rf $(INSTALL_DIR)
mkdir $(INSTALL_DIR)
mkdir -p $(INSTALL_DIR)/{history,screenshots}
echo $(VERSION) > $(INSTALL_DIR)/git-rev
cp -p README.md COPYING kpdfview $(LUA_FILES) $(INSTALL_DIR)
mkdir $(INSTALL_DIR)/data

@ -450,7 +450,6 @@ function FileChooser:addAllCommands()
self.commands:add(KEY_L, nil, "L",
"show last documents",
function(self)
lfs.mkdir("./history/")
FileHistory:init()
FileHistory:choose("")
self.pagedirty = true

@ -109,7 +109,6 @@ end
function Screen:screenshot()
lfs.mkdir("./screenshots")
local start = os.clock()
--showInfoMsgWithDelay("making screenshot... ", 1000, 1)
self:fb2bmp("/dev/fb0", lfs.currentdir().."/screenshots/"..os.date("%Y%m%d%H%M%S")..".bmp", true, nil)

@ -30,7 +30,6 @@ end
function DocSettings:open(docfile)
-- history feature moves configuration files into history directory
lfs.mkdir("./history")
local new = { file = DocToHistory(docfile), data = {} }
local ok, stored = pcall(dofile,new.file)
if not ok then

Loading…
Cancel
Save