@@ -18,7 +18,7 @@ import (
1818 update "github.com/coreos/updatectl/client/update/v1"
1919 "github.com/deis/deisctl/client"
2020 "github.com/deis/deisctl/cmd"
21- "github.com/deis/deisctl/constant"
21+ _ "github.com/deis/deisctl/constant"
2222 "github.com/deis/deisctl/utils"
2323)
2424
@@ -134,13 +134,13 @@ func (c *Client) updateservice() {
134134 // post-install hook (make sure upgrade was successful)
135135}
136136
137- func (c * Client ) downloadFromUrl (url , fileName string ) (err error ) {
138- fmt .Printf ("Downloading %s to %s" , url , fileName )
137+ func (c * Client ) downloadFromUrl (url , filePath string ) (err error ) {
138+ fmt .Printf ("Downloading %s to %s" , url , filePath )
139139
140140 // TODO: check file existence first with io.IsExist
141- output , err := os .Create (constant . UnitsDir + fileName )
141+ output , err := os .Create (filePath )
142142 if err != nil {
143- fmt .Println ("Error while creating" , fileName , "-" , err )
143+ fmt .Println ("Error while creating" , filePath , "-" , err )
144144 return
145145 }
146146 defer output .Close ()
@@ -233,8 +233,8 @@ func (c *Client) SetVersion(resp *omaha.Response) {
233233 uc := resp .Apps [0 ].UpdateCheck
234234 url := c .getCodebaseUrl (uc )
235235 c .MakeRequest ("13" , "1" , false , false )
236- c .downloadFromUrl (url , "deis.tar.gz" )
237- utils .Extract (constant . UnitsDir + " deis.tar.gz" , constant . UnitsDir )
236+ c .downloadFromUrl (url , "/tmp/ deis.tar.gz" )
237+ utils .Extract ("/tmp/ deis.tar.gz" , "/" )
238238 c .MakeRequest ("14" , "1" , false , false )
239239 c .updateservice ()
240240 fmt .Println ("Installation done" )
0 commit comments