mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
perf: verify binary hash right after download
This commit is contained in:
parent
bc60b426b5
commit
765764790a
1 changed files with 3 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ import { getUserLocale } from "./utils"
|
|||
import { GlobalFileNames } from "src/shared/globalFileNames"
|
||||
import { TerminalRegistry } from "src/integrations/terminal/TerminalRegistry"
|
||||
import { assertsMpContext, createHookable, MarketplaceContext, registerMarketplaceHooks } from "roo-rocket"
|
||||
import { unpackFromUint8 } from "config-rocket/cli"
|
||||
import { assertsBinarySha256, unpackFromUint8 } from "config-rocket/cli"
|
||||
import { uint8IsConfigPackWithParameters } from "config-rocket/cli"
|
||||
|
||||
/**
|
||||
|
|
@ -601,6 +601,7 @@ export class MarketplaceManager {
|
|||
assertsMpContext(mpContext)
|
||||
|
||||
const binaryUint8 = await fetchBinary(item.binaryUrl)
|
||||
await assertsBinarySha256(binaryUint8, item.binaryHash)
|
||||
|
||||
// Install via CLI if binary is a configurable pack.
|
||||
// TODO: think of a way to send the binary to the npx process
|
||||
|
|
@ -617,7 +618,7 @@ export class MarketplaceManager {
|
|||
)
|
||||
terminalClass.terminal.show()
|
||||
await terminalClass.runCommand(
|
||||
`npx --yes roo-rocket@latest --mp="${JSON.stringify(mpContext).replaceAll(/"/g, '\\"')}" --cwd="${cwd}" --sha256="${item.binaryHash}" --url="${item.binaryUrl}"`,
|
||||
`npx --yes roo-rocket@latest --mp="${JSON.stringify(mpContext).replaceAll(/"/g, '\\"')}" --cwd="${cwd}" --url="${item.binaryUrl}"`,
|
||||
{
|
||||
onLine: (line) => {
|
||||
pResult.push(line)
|
||||
|
|
@ -651,7 +652,6 @@ export class MarketplaceManager {
|
|||
await unpackFromUint8(binaryUint8, {
|
||||
hookable: customHookable,
|
||||
nonAssemblyBehavior: true,
|
||||
sha256: item.binaryHash,
|
||||
cwd,
|
||||
})
|
||||
vscode.window.showInformationMessage(`"${item.name}" installed successfully`)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue