@@ -95,28 +95,29 @@ target("legacy-script-engine")
9595 " src/legacy"
9696 )
9797 on_load (function (target )
98- local tag = os .iorun (" git describe --tags --abbrev=0 --always" )
99- local major , minor , patch , suffix = tag :match (" v(%d+)%.(%d+)%.(%d+)(.*)" )
100- if not major then
101- print (" Failed to parse version tag, using 0.0.0" )
102- major , minor , patch = 0 , 0 , 0
103- end
104- local versionStr = major .. " ." .. minor .. " ." .. patch
105- if suffix then
106- prerelease = suffix :match (" -(.*)" )
107- if prerelease then
108- prerelease = prerelease :gsub (" \n " , " " )
109- end
98+ local tag = os .iorun (" git describe --tags --abbrev=0 --always" )
99+ local major , minor , patch , suffix = tag :match (" v(%d+)%.(%d+)%.(%d+)(.*)" )
100+ if not major then
101+ print (" Failed to parse version tag, using 0.0.0" )
102+ major , minor , patch = 0 , 0 , 0
103+ end
104+ local versionStr = major .. " ." .. minor .. " ." .. patch
105+ if suffix then
106+ prerelease = suffix :match (" -(.*)" )
107+ if prerelease then
108+ prerelease = prerelease :gsub (" \n " , " " )
110109 end
110+ end
111111
112- if not has_config (" publish" ) then
113- local hash = os .iorun (" git rev-parse --short HEAD" )
114- versionStr = versionStr .. " +" .. hash :gsub (" \n " , " " )
115- end
112+ if not has_config (" publish" ) then
113+ local hash = os .iorun (" git rev-parse --short HEAD" )
114+ versionStr = versionStr .. " +" .. hash :gsub (" \n " , " " )
115+ end
116116
117- target :add (" rules" , " @levibuildscript/modpacker" ,{
118- modVersion = versionStr
119- })
117+ target :add (" rules" , " @levibuildscript/modpacker" ,{
118+ modName = target :basename (),
119+ modVersion = versionStr
120+ })
120121 end )
121122
122123 if is_config (" backend" , " lua" ) then
@@ -129,7 +130,7 @@ target("legacy-script-engine")
129130 after_build (function (target )
130131 local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.lua" )
131132 local langPath = path.join (os.projectdir (), " src/lang/" )
132- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
133+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
133134 local baselibOutputPath = path.join (outputPath , " baselib" )
134135 os .mkdir (baselibOutputPath )
135136 os .cp (baselibPath , baselibOutputPath )
@@ -146,7 +147,7 @@ target("legacy-script-engine")
146147 after_build (function (target )
147148 local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.js" )
148149 local langPath = path.join (os.projectdir (), " src/lang/" )
149- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
150+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
150151 local baselibOutputPath = path.join (outputPath , " baselib" )
151152 os .mkdir (baselibOutputPath )
152153 os .cp (baselibPath , baselibOutputPath )
@@ -162,7 +163,7 @@ target("legacy-script-engine")
162163 after_build (function (target )
163164 local baselibPath = path.join (os.projectdir (), " src/baselib/BaseLib.py" )
164165 local langPath = path.join (os.projectdir (), " src/lang/" )
165- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
166+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
166167 local baselibOutputPath = path.join (outputPath , " baselib" )
167168 os .mkdir (baselibOutputPath )
168169 os .cp (baselibPath , baselibOutputPath )
@@ -178,7 +179,7 @@ target("legacy-script-engine")
178179 set_basename (" legacy-script-engine-nodejs" )
179180 after_build (function (target )
180181 local langPath = path.join (os.projectdir (), " src/lang/" )
181- local outputPath = path.join (os.projectdir (), " bin/" .. target :name ())
182+ local outputPath = path.join (os.projectdir (), " bin/" .. target :basename ())
182183 os .mkdir (outputPath )
183184 os .cp (langPath , outputPath )
184185 end )
0 commit comments