chore(desktop): name the bootstrap cache key and ref policy accurately
cachedScriptPath takes a cache key (often branch-main), not a commit, and downloadInstallScript now receives the branch for existing checkouts too.
This commit is contained in:
@@ -220,15 +220,14 @@ function hasExistingGitCheckout(activeRoot) {
|
||||
}
|
||||
}
|
||||
|
||||
function cachedScriptPath(hermesHome, commit) {
|
||||
return path.join(bootstrapCacheDir(hermesHome), `install-${commit}.${process.platform === 'win32' ? 'ps1' : 'sh'}`)
|
||||
function cachedScriptPath(hermesHome, cacheKey) {
|
||||
return path.join(bootstrapCacheDir(hermesHome), `install-${cacheKey}.${process.platform === 'win32' ? 'ps1' : 'sh'}`)
|
||||
}
|
||||
|
||||
function downloadInstallScript(ref, destPath) {
|
||||
// Fetch from GitHub raw at the install ref. Normal production builds pass a
|
||||
// pinned SHA (immutable). Non-git fallback builds pass an unpinned branch
|
||||
// ref so local builds can still bootstrap without pretending the all-zero
|
||||
// placeholder is a real GitHub commit.
|
||||
// Fetch from GitHub raw at the install ref: the packaged SHA for a fresh
|
||||
// install, the branch for an existing checkout or a non-git fallback stamp
|
||||
// (never the all-zero placeholder, which is not a real GitHub commit).
|
||||
const scriptName = installScriptName()
|
||||
const url = `https://raw.githubusercontent.com/NousResearch/hermes-agent/${ref}/scripts/${scriptName}`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user