Browse Source

Small fix

Guillaume J. Charmes 12 years ago
parent
commit
cfb8cbe521
2 changed files with 4 additions and 1 deletions
  1. 3 0
      buildfile.go
  2. 1 1
      commands.go

+ 3 - 0
buildfile.go

@@ -188,6 +188,9 @@ func (b *buildFile) CmdInsert(args string) error {
 }
 
 func (b *buildFile) CmdAdd(args string) error {
+	if b.context == "" {
+		return fmt.Errorf("No context given. Impossible to use ADD")
+	}
 	tmp := strings.SplitN(args, " ", 2)
 	if len(tmp) != 2 {
 		return fmt.Errorf("Invalid INSERT format")

+ 1 - 1
commands.go

@@ -175,7 +175,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
 		if _, err := w.CreateFormFile("Context", cmd.Arg(0)+"."+compression.Extension()); err != nil {
 			return err
 		}
-		multipartBody = io.MultiReader(multipartBody, utils.ProgressReader(ioutil.NopCloser(context), -1, os.Stdout, "Uploading Context %v/%v (%v)", false))
+		multipartBody = io.MultiReader(multipartBody, utils.ProgressReader(ioutil.NopCloser(context), -1, os.Stdout, "Uploading Context %v/%v (%v)\r", false))
 	}
 
 	// Send the multipart request with correct content-type