From 13cae3a37561af3692f7d8b40d7fa831433de269 Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Wed, 22 Jan 2025 12:16:20 +0530 Subject: [PATCH] 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. --- toolchainlib/src/init.luau | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolchainlib/src/init.luau b/toolchainlib/src/init.luau index fa7d5b7..cdf1173 100644 --- a/toolchainlib/src/init.luau +++ b/toolchainlib/src/init.luau @@ -164,7 +164,7 @@ local function getGithubToken(): Option end -- Initialize the shared global progress bar state -_G.interactive = false +_G.interactive = nil local barFns function installTool(tool: ToolId, installPath: pathfs.Path): number @@ -359,7 +359,9 @@ return setmetatable( } :: LibExports, { __call = function(lib: LibExportsImpl, tool: string, pesdeRoot: string?): number - _G.interactive = true + if _G.interactive == nil then + _G.interactive = true + end local repo, version = string.match(tool, "([^@]+)@?(.*)") if repo == nil or version == nil then