-
-
Notifications
You must be signed in to change notification settings - Fork 640
include
Jason Perkins edited this page Apr 14, 2015
·
7 revisions
The include function looks for an executes another script file, if it hasn't been run previously.
#!lua
include("path")
path is the file system path to a script file or a directory. If a directory is specified, Premake looks like a file named premake5.lua in that directory and runs it if found.
If the file or directory specified has already been included previously, the call is ignored. If you want to execute the same script multiple times, use Lua's dofile() instead.
Any values returned by the included script are passed through to the caller.
#!lua
-- runs "src/MyApplication/premake5.lua"
include "src/MyApplication"
-- runs "my_script.lua" just once
include "my_script.lua"
include "my_script.lua"