Skip to content

Commit

Permalink
Add a flag to use rsync instead of scp
Browse files Browse the repository at this point in the history
Signed-off-by: Anders F Björklund <[email protected]>
  • Loading branch information
afbjorklund committed Apr 28, 2024
1 parent b4f04bf commit 12e678b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/limactl/guest_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func newGuestInstallCommand() *cobra.Command {
ValidArgsFunction: cobra.NoFileCompletions,
Hidden: true,
}
guestInstallCommand.Flags().BoolP("rsync", "", false, "use rsync")
return guestInstallCommand
}

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

func guestInstallAction(cmd *cobra.Command, args []string) error {
rsync, err := cmd.Flags().GetBool("rsync")
if err != nil {
return err
}

instName := DefaultInstanceName
if len(args) > 0 {
instName = args[0]
Expand All @@ -55,6 +61,10 @@ func guestInstallAction(cmd *cobra.Command, args []string) error {

scpExe := "scp"
scpFlags := sshFlags
if rsync {
scpExe = "rsync"
scpFlags = []string{"-e", "ssh -F " + sshConfig, "--progress"}
}

y, err := inst.LoadYAML()
if err != nil {
Expand Down

0 comments on commit 12e678b

Please sign in to comment.