[*] improve feature script cwd awareness
This commit is contained in:
parent
ad4696983a
commit
21e2df1ebb
@ -72,12 +72,17 @@ if (projectBins) then
|
||||
end
|
||||
|
||||
local cwd = _OPTIONS["cwd"]
|
||||
local passThroughCWD = nil
|
||||
if (cwd) then
|
||||
os.chdir(projRoot)
|
||||
passThroughCWD = projRoot
|
||||
else
|
||||
os.chdir(Aurora.Settings.sAbsRoot)
|
||||
passThroughCWD = Aurora.Settings.sAbsRoot
|
||||
end
|
||||
|
||||
local root = Aurora.Settings.sAbsRoot
|
||||
|
||||
local args = _OPTIONS["additional"]
|
||||
if (args) then
|
||||
local path = _G.path.join(Aurora.Settings.sAbsCompilerWd, args .. ".args")
|
||||
@ -198,15 +203,22 @@ auBuild =
|
||||
projectTargetName = targetName,
|
||||
projectTargetFileName = fileName,
|
||||
args = args,
|
||||
root = cwd
|
||||
root = root,
|
||||
cwd = passThroughCWD
|
||||
}
|
||||
|
||||
local luaScript = _OPTIONS["luascript"]
|
||||
local luaAbsScript = _OPTIONS["luaabsscript"]
|
||||
local fn = nil
|
||||
if (luaScript) then
|
||||
auRequireAbs(path.join(Aurora.Settings.sAbsRepoScripts, luaScript))
|
||||
fn = auRequireAbs(path.join(Aurora.Settings.sAbsRepoScripts, luaScript))
|
||||
elseif (luaAbsScript) then
|
||||
auRequireAbs(path.join(Aurora.Settings.sAbsRoot, luaAbsScript))
|
||||
fn = auRequireAbs(path.join(Aurora.Settings.sAbsRoot, luaAbsScript))
|
||||
end
|
||||
|
||||
if (type(fn) == "function") then
|
||||
os.chdir(passThroughCWD)
|
||||
fn()
|
||||
end
|
||||
|
||||
os.exit()
|
@ -1,3 +1,4 @@
|
||||
local function doAction()
|
||||
local projectName = auBuild.projectName
|
||||
local version = auBuild.projectRoot .. "/Version.json"
|
||||
|
||||
@ -22,8 +23,6 @@ local includeGit = manifest.includeGit
|
||||
|
||||
local commitString = ""
|
||||
|
||||
os.chdir(auBuild.root)
|
||||
|
||||
if (includeGit) then
|
||||
local cmd = nil
|
||||
if (auBuild.shortGitCommit) then
|
||||
@ -224,3 +223,6 @@ local formattedCTemplate = string.format(cTemplate,
|
||||
)
|
||||
|
||||
io.writefile(versionC, formattedCTemplate)
|
||||
end
|
||||
|
||||
return doAction
|
Loading…
Reference in New Issue
Block a user