Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging around CLI download fallback case #533

Open
angrycub opened this issue Feb 12, 2025 · 0 comments
Open

Add logging around CLI download fallback case #533

angrycub opened this issue Feb 12, 2025 · 0 comments

Comments

@angrycub
Copy link

In CoderCLIManager, we have a fallback behavior to download the CLI to the data-dir. We should log something somewhere to let folks know that this is happening.

// If downloads are enabled download the new version.
if (settings.enableDownloads) {
indicator?.invoke("Downloading Coder CLI...")
try {
cli.download()
return cli
} catch (e: java.nio.file.AccessDeniedException) {
// Might be able to fall back to the data directory.
val binPath = settings.binPath(deploymentURL)
val dataDir = settings.dataDir(deploymentURL)
if (binPath.parent == dataDir || !settings.enableBinaryDirectoryFallback) {
throw e
}
}
}
// Try falling back to the data directory.
val dataCLI = CoderCLIManager(deploymentURL, settings, true)
val dataCLIMatches = dataCLI.matchesVersion(buildVersion)
if (dataCLIMatches == true) {
return dataCLI
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant