mirror of
https://github.com/TangentFoxy/.lua-files.git
synced 2024-11-20 21:34:23 +00:00
turns out my method of requiring utility-functions wasn't correct
This commit is contained in:
parent
ef896d140d
commit
48a3cce7f3
23
test.lua
23
test.lua
@ -2,11 +2,28 @@
|
|||||||
|
|
||||||
-- if utility-functions.lua has an error, this won't show it, so for testing purposes, I don't use it here
|
-- if utility-functions.lua has an error, this won't show it, so for testing purposes, I don't use it here
|
||||||
-- local error_occurred, utility = pcall(function() return require("utility-functions") end) if not error_occurred then error("This script is installed improperly. Follow instructions at https://github.com/TangentFoxy/.lua-files#installation") end
|
-- local error_occurred, utility = pcall(function() return require("utility-functions") end) if not error_occurred then error("This script is installed improperly. Follow instructions at https://github.com/TangentFoxy/.lua-files#installation") end
|
||||||
utility = require("utility-functions")
|
-- utility = require("utility-functions")
|
||||||
|
|
||||||
|
|
||||||
print("---")
|
print("---")
|
||||||
|
|
||||||
local threads = tonumber(arg[1]) or arg[1] or 1
|
local error_occurred, utility = pcall(function() return dofile(arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)") .. "utility-functions.lua") end) if not error_occurred then error("\n\nThis script is installed improperly. Follow instructions at:\n\thttps://github.com/TangentFoxy/.lua-files#installation\n") end
|
||||||
print(threads, type(threads))
|
print("Success?")
|
||||||
|
|
||||||
|
-- local error_occurred, utility = pcall(
|
||||||
|
-- function()
|
||||||
|
-- local path = arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")
|
||||||
|
-- return require(path .. "utility-functions")
|
||||||
|
-- end)
|
||||||
|
-- if not error_occurred then
|
||||||
|
-- error("\n\nThis script is installed improperly. Follow instructions at:\n\thttps://github.com/TangentFoxy/.lua-files#installation\n")
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- local path = arg[0]:match("@?(.*/)") or arg[0]:match("@?(.*\\)")
|
||||||
|
-- utility = dofile(path .. "utility-functions.lua")
|
||||||
|
-- print(utility)
|
||||||
|
for k,v in pairs(utility) do
|
||||||
|
print(k,v)
|
||||||
|
end
|
||||||
|
|
||||||
print("---")
|
print("---")
|
||||||
|
Loading…
Reference in New Issue
Block a user