MCPcopy
hub / github.com/lima-vm/lima / rsyncDirectory

Function rsyncDirectory

cmd/limactl/shell.go:705–714  ·  view source on GitHub ↗

Syncs a directory from host to guest and vice-versa. It creates a directory in the guest's home directory and copies the contents of the host's current working directory into it. The guest directory paths should be prefixed with ` :` followed by the path.

(ctx context.Context, cmd *cobra.Command, rsync copytool.CopyTool, paths []string)

Source from the content-addressed store, hash-verified

703// Syncs a directory from host to guest and vice-versa. It creates a directory in the guest's home directory and copies the contents of the host's
704// current working directory into it. The guest directory paths should be prefixed with `<InstanceName>:` followed by the path.
705func rsyncDirectory(ctx context.Context, cmd *cobra.Command, rsync copytool.CopyTool, paths []string) error {
706 rsyncCmd, err := rsync.Command(ctx, paths, nil)
707 if err != nil {
708 return err
709 }
710 rsyncCmd.Stdout = cmd.OutOrStdout()
711 rsyncCmd.Stderr = cmd.OutOrStderr()
712 logrus.Debugf("executing rsync: %+v", rsyncCmd.Args)
713 return rsyncCmd.Run()
714}
715
716func mountDirFromWindowsDir(ctx context.Context, inst *limatype.Instance, dir string) (string, error) {
717 if inst.VMType == limatype.WSL2 {

Callers 2

shellActionFunction · 0.85
askUserForRsyncBackFunction · 0.85

Calls 2

CommandMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected