require the argument

This commit is contained in:
Kartik K. Agaram 2023-10-20 00:04:23 -07:00
parent 459b1df08a
commit b2785ac191
2 changed files with 8 additions and 7 deletions

View File

@ -1,10 +1,11 @@
on.initialize = function(arg)
if #arg > 0 then
if is_absolute_path(arg[1]) then
Data_dir = arg[1]
else
Data_dir = App.current_dir..arg[1]
end
if #arg == 0 then
error('please provide a directory to browse')
end
if is_absolute_path(arg[1]) then
Data_dir = arg[1]
else
Data_dir = App.current_dir..arg[1]
end
print('reading articles from '..Data_dir)
if not file_exists(Data_dir) then

View File

@ -1 +1 @@
Data_dir = App.save_dir .. 'data'
Data_dir = nil