databricks-cli/cmd
Miles Yucht 07c4c90772
Tolerate missing .databrickscfg file during `databricks auth login` (#1003)
## Changes
`databricks configure` creates a new .databrickscfg if one doesn't
already exist, but `databricks auth login` fails in this case. Because
`databricks auth login` anyways writes out the config file, we
gracefully handle this error and continue.

## Tests
Unit test.

```
$ ls ~/.databrickscfg*    
/Users/miles/.databrickscfg.bak

$ ./cli auth login
Databricks Profile Name: test
Databricks Host: https://<HOST>
Profile test was successfully saved

$ ls ~/.databrickscfg*
/Users/miles/.databrickscfg     /Users/miles/.databrickscfg.bak

$ cat ~/.databrickscfg
; The profile defined in the DEFAULT section is to be used as a fallback when no profile is explicitly specified.
[DEFAULT]

[test]
host      = https://<HOST>
auth_type = databricks-cli
```
2023-11-23 09:04:54 +00:00
..
account Bump github.com/databricks/databricks-sdk-go from 0.24.0 to 0.25.0 (#980) 2023-11-13 15:38:35 +00:00
api Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
auth Tolerate missing .databrickscfg file during `databricks auth login` (#1003) 2023-11-23 09:04:54 +00:00
bundle Make `file_path` and `artifact_path` fields consistent with json tag (#987) 2023-11-15 13:37:26 +00:00
configure Make `databricks configure` save only explicit fields (#973) 2023-11-10 14:03:57 +00:00
fs Remove dependency on global state for remaining commands (#613) 2023-07-27 10:03:08 +00:00
labs Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00
root Add `--debug` as shortcut for `--log-level debug` (#964) 2023-11-09 10:40:47 +00:00
sync Make `file_path` and `artifact_path` fields consistent with json tag (#987) 2023-11-15 13:37:26 +00:00
version Added description for version command (#737) 2023-09-06 08:41:47 +00:00
workspace Bump github.com/databricks/databricks-sdk-go from 0.24.0 to 0.25.0 (#980) 2023-11-13 15:38:35 +00:00
cmd.go Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00