mirror of https://github.com/databricks/cli.git
resolving review comments
This commit is contained in:
parent
c514cca929
commit
41313db1b2
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"[go]": {
|
||||
"editor.insertSpaces": false,
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"go.lintTool": "golangci-lint",
|
||||
"go.lintFlags": [
|
||||
"--fast"
|
||||
],
|
||||
"go.useLanguageServer": true,
|
||||
"gopls": {
|
||||
"formatting.gofumpt": true
|
||||
},
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.insertFinalNewline": true,
|
||||
"files.trimFinalNewlines": true,
|
||||
"python.envFile": "${workspaceRoot}/.env",
|
||||
"python.analysis.stubPath": ".vscode",
|
||||
"jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])",
|
||||
"jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------"
|
||||
}
|
|
@ -23,9 +23,10 @@ func NewReleaseCache(org, repo, cacheDir string) *ReleaseCache {
|
|||
}
|
||||
|
||||
type ReleaseCache struct {
|
||||
Cache localcache.LocalCache[Versions]
|
||||
Org string
|
||||
Repo string
|
||||
Cache localcache.LocalCache[Versions]
|
||||
Org string
|
||||
Repo string
|
||||
Offline bool
|
||||
}
|
||||
|
||||
func (r *ReleaseCache) Load(ctx context.Context) (Versions, error) {
|
||||
|
|
|
@ -10,7 +10,7 @@ func newInstallCommand() *cobra.Command {
|
|||
cmd := &cobra.Command{}
|
||||
var offlineInstall bool
|
||||
|
||||
cmd.Flags().BoolVar(&offlineInstall, "offline-install", offlineInstall, `If installing in offline mode, set this flag to true.`)
|
||||
cmd.Flags().BoolVar(&offlineInstall, "offline", offlineInstall, `If installing in offline mode, set this flag to true.`)
|
||||
|
||||
cmd.Use = "install NAME"
|
||||
cmd.Args = root.ExactArgs(1)
|
||||
|
|
|
@ -127,12 +127,7 @@ func (f *fetcher) checkReleasedVersions(cmd *cobra.Command, version string, offl
|
|||
// `databricks labs isntall X` doesn't know which exact version to fetch, so first
|
||||
// we fetch all versions and then pick the latest one dynamically.
|
||||
var versions github.Versions
|
||||
if offlineInstall {
|
||||
versions, err = github.NewReleaseCache("databrickslabs", f.name, cacheDir).LoadCache(ctx)
|
||||
} else {
|
||||
versions, err = github.NewReleaseCache("databrickslabs", f.name, cacheDir).Load(ctx)
|
||||
}
|
||||
|
||||
versions, err = github.NewReleaseCache("databrickslabs", f.name, cacheDir, offlineInstall).Load(ctx)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("versions: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue