1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fixed docker.fake so that fake.StartCommand() can be used on Darwin for testing

This commit is contained in:
Solomon Hykes 2013-01-28 23:16:41 -08:00
parent 2dadcf9b81
commit d8a4910eee

View file

@ -5,9 +5,7 @@ import (
"math/rand"
"io"
"archive/tar"
"github.com/dotcloud/docker"
"os/exec"
"strings"
"github.com/kr/pty"
)
@ -56,27 +54,8 @@ func ContainerRunning() bool {
return false
}
type Container struct {
*docker.Container
Name string
Source string
Size uint
FilesChanged uint
BytesChanged uint
}
func NewContainer(c *docker.Container) *Container {
return &Container{
Container: c,
Name: c.GetUserData("name"),
}
}
func (c *Container) CmdString() string {
return strings.Join(append([]string{c.Path}, c.Args...), " ")
}
func startCommand(cmd *exec.Cmd, interactive bool) (io.WriteCloser, io.ReadCloser, error) {
func StartCommand(cmd *exec.Cmd, interactive bool) (io.WriteCloser, io.ReadCloser, error) {
if interactive {
term, err := pty.Start(cmd)
if err != nil {