summaryrefslogtreecommitdiff
path: root/xmake/actions/create/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-19 00:55:37 +0800
committerruki <[email protected]>2019-09-18 23:33:46 +0800
commit336029c68e4d0fc58bb55dca3ce5fb62bfdbf41b (patch)
tree68072128ac59708b7f56615e626d87e30ed951e2 /xmake/actions/create/main.lua
parentbb3455b845e0b776937283b3ddae4ae557eea52e (diff)
rewrite templates
Diffstat (limited to 'xmake/actions/create/main.lua')
-rw-r--r--xmake/actions/create/main.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua
index d2737c258..eeeb7ade4 100644
--- a/xmake/actions/create/main.lua
+++ b/xmake/actions/create/main.lua
@@ -43,6 +43,9 @@ function _create_project(tempinst, sourcedir, targetname)
-- copy the project files
os.cp(path.join(sourcedir, "*"), projectdir)
+ -- enter the project directory
+ os.cd(projectdir)
+
-- get the builtin variables
local builtinvars = _get_builtinvars(tempinst, targetname)
@@ -58,6 +61,12 @@ function _create_project(tempinst, sourcedir, targetname)
-- generate .gitignore
os.cp(path.join(os.programdir(), "scripts", "gitignore"), path.join(projectdir, ".gitignore"))
+
+ -- do after_create
+ local after_create = tempinst:get("create_after")
+ if after_create then
+ after_create(tempinst)
+ end
end
-- create project or files from template