~jasper/knockoff

039307983f109ed43bfa5c0995beb97c8c6d796f — Jasper den Ouden 3 years ago 635f33b
Searching for the file should just return `nil`. This fixes getting the correct return when it is not found
2 files changed, 3 insertions(+), 2 deletions(-)

M src/inbuild.lua
M src/include.lua
M src/inbuild.lua => src/inbuild.lua +2 -1
@@ 110,7 110,8 @@ if args[2] and string.match(args[2], "^.+[.]lua$") then
else  -- Otherwise, figure out the file.
    args.config_file = include_file(args[2])
    if not args.config_file then
        log(0, "Configuration %s doesnt exist.", args[2])
        log(0, "No file corresponding to configuration file `%s` found.",
            args[2])
        env.dont_run = true
        return
    end

M src/include.lua => src/include.lua +1 -1
@@ 11,7 11,6 @@ function include_file(name)
            return dir .. name .. ".lua"
        end
    end
    assert(false, "File `" .. name .. "` doesnt exist.")
end

local included, on_way = {}, {}


@@ 26,6 25,7 @@ function include(name)
    on_way[name] = true

    local file = include_file(name)
    assert(file, "File `" .. name .. "` doesnt exist.")

    got, err = loadfile(file, nil, env)
    if got then