mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-01-09 15:59:09 +00:00
fix(lib): propagate ProgressBar
results and handle them
This commit is contained in:
parent
e323dc08a3
commit
76e434ec6d
1 changed files with 9 additions and 5 deletions
|
@ -120,7 +120,11 @@ end
|
|||
local function makeConditionalBar()
|
||||
local function makeConditional(fn: (ProgressBar.ProgressBarImpl) -> ())
|
||||
return function(bar: ProgressBar.ProgressBarImpl)
|
||||
local _ = _G.interactive and fn(bar)
|
||||
if _G.interactive then
|
||||
return fn(bar)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -157,7 +161,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
|||
}) :: Option<Github.Config>
|
||||
)
|
||||
|
||||
barFns.next(bar) -- fetch
|
||||
barFns.next(bar):unwrap() -- fetch
|
||||
local releases = client:queueTransactions({ "FetchReleases" })[1]:unwrap() :: GithubReleases
|
||||
local assets = tool.version:match({
|
||||
Some = function(version: string)
|
||||
|
@ -175,7 +179,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
|||
end,
|
||||
})
|
||||
|
||||
barFns.next(bar) -- locate
|
||||
barFns.next(bar):unwrap() -- locate
|
||||
-- TODO: Use index type fn in solver v2
|
||||
local matchingAsset: {
|
||||
name: string,
|
||||
|
@ -199,7 +203,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
|||
end
|
||||
end
|
||||
|
||||
barFns.next(bar) -- download
|
||||
barFns.next(bar):unwrap() -- download
|
||||
|
||||
local binaryPath: pathfs.Path
|
||||
if matchingAsset == nil then
|
||||
|
@ -230,7 +234,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
|||
end
|
||||
end
|
||||
|
||||
barFns.next(bar) -- install
|
||||
barFns.next(bar):unwrap() -- install
|
||||
|
||||
-- Maintain multiple versions of a tool, and avoid downloading
|
||||
-- the binary for a version again if it's already there
|
||||
|
|
Loading…
Reference in a new issue