mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-03-04 02:51:47 +00:00
feat(lib): make it possible to override interactivity state externally
Libraries that depend on toolchainlib can now set `_G.interactive` manually and have that option be respected.
This commit is contained in:
parent
c85c895408
commit
13cae3a375
1 changed files with 4 additions and 2 deletions
|
@ -164,7 +164,7 @@ local function getGithubToken(): Option<string>
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Initialize the shared global progress bar state
|
-- Initialize the shared global progress bar state
|
||||||
_G.interactive = false
|
_G.interactive = nil
|
||||||
local barFns
|
local barFns
|
||||||
|
|
||||||
function installTool(tool: ToolId, installPath: pathfs.Path): number
|
function installTool(tool: ToolId, installPath: pathfs.Path): number
|
||||||
|
@ -359,7 +359,9 @@ return setmetatable(
|
||||||
} :: LibExports,
|
} :: LibExports,
|
||||||
{
|
{
|
||||||
__call = function(lib: LibExportsImpl, tool: string, pesdeRoot: string?): number
|
__call = function(lib: LibExportsImpl, tool: string, pesdeRoot: string?): number
|
||||||
|
if _G.interactive == nil then
|
||||||
_G.interactive = true
|
_G.interactive = true
|
||||||
|
end
|
||||||
|
|
||||||
local repo, version = string.match(tool, "([^@]+)@?(.*)")
|
local repo, version = string.match(tool, "([^@]+)@?(.*)")
|
||||||
if repo == nil or version == nil then
|
if repo == nil or version == nil then
|
||||||
|
|
Loading…
Add table
Reference in a new issue