Skip to content

Commit 0599caa

Browse files
author
Oleg Sucharevich
committed
fix bug, workflow id was returns with quotes after pipeline.run
1 parent 7ba5868 commit 0599caa

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.0
1+
0.7.1

pkg/codefresh/codefresh.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func (c *codefresh) getBodyAsString(resp *http.Response) (string, error) {
8585
}
8686

8787
func (c *codefresh) getBodyAsBytes(resp *http.Response) ([]byte, error) {
88+
defer resp.Body.Close()
8889
body, err := ioutil.ReadAll(resp.Body)
8990
if err != nil {
9091
return nil, err

pkg/codefresh/pipeline.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package codefresh
33
import (
44
"fmt"
55
"net/url"
6+
"strings"
67
"time"
78
)
89

@@ -86,6 +87,9 @@ func (p *pipeline) List() ([]*Pipeline, error) {
8687

8788
func (p *pipeline) Run(name string, options *RunOptions) (string, error) {
8889
variables := []string{}
90+
if options == nil {
91+
options = &RunOptions{}
92+
}
8993
for k, v := range options.Variables {
9094
variables = append(variables, fmt.Sprintf("%s=%s", k, v))
9195
}
@@ -100,5 +104,6 @@ func (p *pipeline) Run(name string, options *RunOptions) (string, error) {
100104
if err != nil {
101105
return "", err
102106
}
103-
return p.codefresh.getBodyAsString(resp)
107+
res, err := p.codefresh.getBodyAsString(resp)
108+
return strings.Replace(res, "\"", "", -1), err
104109
}

0 commit comments

Comments
 (0)