Introduce podman machine cp command

Add a new `podman machine cp` subcommand to allow users to copy files or
directories between a running Podman Machine and their host.

Tests cover the following cases:
- Copy a file from the host machine to the VM
- Copy a directory from the host machine to the VM
- Copy a file from the VM to the host machine
- Copy a directory from the VM to the host machine
- Copy a file to a directory
- Copy a directory to a file

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
Jake Correnti
2025-02-13 09:12:13 -05:00
parent 350429cc3c
commit 42fb942a6f
9 changed files with 485 additions and 22 deletions

View File

@ -7,7 +7,7 @@ import (
"unicode"
)
func isHostWinPath(path string) bool {
func IsHostWinPath(path string) bool {
return shouldResolveWinPaths() && strings.HasPrefix(path, `\\`) || hasWinDriveScheme(path, 0) || winPathExists(path)
}