Skip to content

Commit

Permalink
feat: Warn about missing static_dir directory
Browse files Browse the repository at this point in the history
  • Loading branch information
open-dynaMIX committed Dec 17, 2021
1 parent b3b8f83 commit ad8daf9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1006,14 +1006,20 @@ local function parse_collections()
local collections = {}
for collection in string.gmatch(options.collections, "[^;]+") do
if not is_dir(collection) then
mp.msg.error("No such directory: " .. collection)
mp.msg.error("No such collection directory: " .. collection)
else
table.insert(collections, collection)
end
end
options.collections = collections
end

local function validate_static_dir()
if not is_dir(options.static_dir) then
mp.msg.log("WARN", "No such static_dir directory: " .. options.static_dir)
end
end

if options.disable then
mp.msg.info("disabled")
message = function() log_osd("disabled") end
Expand All @@ -1025,6 +1031,7 @@ end
local passwd = get_passwd(options.htpasswd_path)
local servers = init_servers()
parse_collections()
validate_static_dir()

if passwd ~= 1 then
if next(servers) == nil then
Expand Down

0 comments on commit ad8daf9

Please sign in to comment.