Skip to content

Commit a63be72

Browse files
committed
Add a flag to use rsync instead of scp
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 29286b3 commit a63be72

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/limactl/guest_install.go

+10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func newGuestInstallCommand() *cobra.Command {
2424
ValidArgsFunction: cobra.NoFileCompletions,
2525
Hidden: true,
2626
}
27+
guestInstallCommand.Flags().BoolP("rsync", "", false, "use rsync")
2728
return guestInstallCommand
2829
}
2930

@@ -36,6 +37,11 @@ func runCmd(name string, flags []string, args ...string) error {
3637
}
3738

3839
func guestInstallAction(cmd *cobra.Command, args []string) error {
40+
rsync, err := cmd.Flags().GetBool("rsync")
41+
if err != nil {
42+
return err
43+
}
44+
3945
instName := DefaultInstanceName
4046
if len(args) > 0 {
4147
instName = args[0]
@@ -55,6 +61,10 @@ func guestInstallAction(cmd *cobra.Command, args []string) error {
5561

5662
scpExe := "scp"
5763
scpFlags := sshFlags
64+
if rsync {
65+
scpExe = "rsync"
66+
scpFlags = []string{"-e", "ssh -F " + sshConfig, "--progress"}
67+
}
5868

5969
y, err := inst.LoadYAML()
6070
if err != nil {

0 commit comments

Comments
 (0)