databricks-cli/cmd
shreyas-goenka 2c0d06715c
Fix windows style file paths in fs cp command (#1118)
## Changes
Copying a local file in windows to remote directory in DBFS would fail
if the path was specified as a windows style path (compared to a UNIX
style path). This PR fixes that.

Note, UNIX style paths will continue to work because `filepath.Base`
respects both `/` and `\` as file separators. See: `IsPathSeparator` in
https://go.dev/src/os/path_windows.go.

Fixes issue: https://github.com/databricks/cli/issues/1109.

## Tests
Integration test and manually
```
C:\Users\shreyas.goenka>Desktop\cli.exe fs cp .\Desktop\foo.txt dbfs:/Users/shreyas.goenka@databricks.com
.\Desktop\foo.txt -> dbfs:/Users/shreyas.goenka@databricks.com/foo.txt

C:\Users\shreyas.goenka>Desktop\cli.exe fs cat  dbfs:/Users/shreyas.goenka@databricks.com/foo.txt
hello, world
````
2024-01-11 18:49:42 +00:00
..
account Upgrade Go SDK to v0.29.0 (#1111) 2024-01-11 08:16:25 +00:00
api Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
auth Ask for host when .databrickscfg doesn't exist (#1041) 2023-12-04 15:40:52 +00:00
bundle Tweak command groups in CLI help (#1092) 2023-12-28 13:14:55 +00:00
configure Filter out system clusters for `--configure-cluster` (#1031) 2023-11-30 09:59:11 +00:00
fs Fix windows style file paths in fs cp command (#1118) 2024-01-11 18:49:42 +00:00
labs Do not allow input prompts in Git Bash terminal (#1069) 2023-12-18 15:01:59 +00:00
root Always log with text format by default (#1096) 2024-01-03 09:39:33 +00:00
sync Tweak command groups in CLI help (#1092) 2023-12-28 13:14:55 +00:00
version Added description for version command (#737) 2023-09-06 08:41:47 +00:00
workspace Upgrade Go SDK to v0.29.0 (#1111) 2024-01-11 08:16:25 +00:00
cmd.go Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00