Example #1
0
// Copy uses rsync to copy one or more src files to dst.
func (c Client) Copy(dst string, src ...string) error {
	cmd, err := c.Command(dst, src...)
	if err != nil {
		return err
	}
	return exec.RunCommand(cmd)
}
Example #2
0
// RunCommand uses ssh to execute a command on a remote machine.
func (c Client) RunCommand(args []string) error {
	if len(args) == 0 {
		return errors.New("no command given")
	}
	if c.Host == "" {
		return errors.New("no host given")
	}
	return exec.RunCommand(c.Command(args))
}
Example #3
0
// RunCommand runs the specified command on the host system.
func (drv Driver) RunCommand(args []string) error {
	return exec.RunCommand(args)
}
Example #4
0
// Resolve runs Librarian-Chef to install cookbook dependencies to dst.
func (r Resolver) Resolve(dst string) error {
	return exec.RunCommand(Command(dst))
}
Example #5
0
// Resolve runs Berkshelf to install cookbook dependencies to dst.
func (r Resolver) Resolve(dst string) error {
	if err := os.RemoveAll(dst); err != nil {
		return err
	}
	return exec.RunCommand(Command(dst))
}