@@ -18,19 +18,19 @@ import (
1818
1919// AppCreate creates an app.
2020func AppCreate (id string , buildpack string , remote string , noRemote bool ) error {
21- c , err := settings .Load ()
21+ s , err := settings .Load ()
2222 if err != nil {
2323 return err
2424 }
2525
2626 fmt .Print ("Creating Application... " )
2727 quit := progress ()
28- app , err := apps .New (c , id )
28+ app , err := apps .New (s . Client , id )
2929
3030 quit <- true
3131 <- quit
3232
33- if checkAPICompatibility (c , err ) != nil {
33+ if checkAPICompatibility (s . Client , err ) != nil {
3434 return err
3535 }
3636
@@ -42,13 +42,13 @@ func AppCreate(id string, buildpack string, remote string, noRemote bool) error
4242 "BUILDPACK_URL" : buildpack ,
4343 },
4444 }
45- if _ , err = config .Set (c , app .ID , configValues ); checkAPICompatibility (c , err ) != nil {
45+ if _ , err = config .Set (s . Client , app .ID , configValues ); checkAPICompatibility (s . Client , err ) != nil {
4646 return err
4747 }
4848 }
4949
5050 if ! noRemote {
51- if err = git .CreateRemote (c .ControllerURL .Host , remote , app .ID ); err != nil {
51+ if err = git .CreateRemote (s . Client .ControllerURL .Host , remote , app .ID ); err != nil {
5252 if err .Error () == "exit status 128" {
5353 fmt .Println ("To replace the existing git remote entry, run:" )
5454 fmt .Printf (" git remote rename deis deis.old && deis git:remote -a %s\n " , app .ID )
@@ -60,26 +60,26 @@ func AppCreate(id string, buildpack string, remote string, noRemote bool) error
6060 if noRemote {
6161 fmt .Printf ("If you want to add a git remote for this app later, use `deis git:remote -a %s`\n " , app .ID )
6262 } else {
63- fmt .Println ("remote available at" , git .RemoteURL (c .ControllerURL .Host , app .ID ))
63+ fmt .Println ("remote available at" , git .RemoteURL (s . Client .ControllerURL .Host , app .ID ))
6464 }
6565
6666 return nil
6767}
6868
6969// AppsList lists apps on the Deis controller.
7070func AppsList (results int ) error {
71- c , err := settings .Load ()
71+ s , err := settings .Load ()
7272
7373 if err != nil {
7474 return err
7575 }
7676
7777 if results == defaultLimit {
78- results = c . ResponseLimit
78+ results = s . Limit
7979 }
8080
81- apps , count , err := apps .List (c , results )
82- if checkAPICompatibility (c , err ) != nil {
81+ apps , count , err := apps .List (s . Client , results )
82+ if checkAPICompatibility (s . Client , err ) != nil {
8383 return err
8484 }
8585
@@ -93,14 +93,14 @@ func AppsList(results int) error {
9393
9494// AppInfo prints info about app.
9595func AppInfo (appID string ) error {
96- c , appID , err := load (appID )
96+ s , appID , err := load (appID )
9797
9898 if err != nil {
9999 return err
100100 }
101101
102- app , err := apps .Get (c , appID )
103- if checkAPICompatibility (c , err ) != nil {
102+ app , err := apps .Get (s . Client , appID )
103+ if checkAPICompatibility (s . Client , err ) != nil {
104104 return err
105105 }
106106
@@ -131,14 +131,14 @@ func AppInfo(appID string) error {
131131
132132// AppOpen opens an app in the default webbrowser.
133133func AppOpen (appID string ) error {
134- c , appID , err := load (appID )
134+ s , appID , err := load (appID )
135135
136136 if err != nil {
137137 return err
138138 }
139139
140- app , err := apps .Get (c , appID )
141- if checkAPICompatibility (c , err ) != nil {
140+ app , err := apps .Get (s . Client , appID )
141+ if checkAPICompatibility (s . Client , err ) != nil {
142142 return err
143143 }
144144
@@ -152,14 +152,14 @@ func AppOpen(appID string) error {
152152
153153// AppLogs returns the logs from an app.
154154func AppLogs (appID string , lines int ) error {
155- c , appID , err := load (appID )
155+ s , appID , err := load (appID )
156156
157157 if err != nil {
158158 return err
159159 }
160160
161- logs , err := apps .Logs (c , appID , lines )
162- if checkAPICompatibility (c , err ) != nil {
161+ logs , err := apps .Logs (s . Client , appID , lines )
162+ if checkAPICompatibility (s . Client , err ) != nil {
163163 return err
164164 }
165165
@@ -184,16 +184,16 @@ func printLogs(logs string) error {
184184
185185// AppRun runs a one time command in the app.
186186func AppRun (appID , command string ) error {
187- c , appID , err := load (appID )
187+ s , appID , err := load (appID )
188188
189189 if err != nil {
190190 return err
191191 }
192192
193193 fmt .Printf ("Running '%s'...\n " , command )
194194
195- out , err := apps .Run (c , appID , command )
196- if checkAPICompatibility (c , err ) != nil {
195+ out , err := apps .Run (s . Client , appID , command )
196+ if checkAPICompatibility (s . Client , err ) != nil {
197197 return err
198198 }
199199
@@ -211,14 +211,14 @@ func AppRun(appID, command string) error {
211211func AppDestroy (appID , confirm string ) error {
212212 gitSession := false
213213
214- c , err := settings .Load ()
214+ s , err := settings .Load ()
215215
216216 if err != nil {
217217 return err
218218 }
219219
220220 if appID == "" {
221- appID , err = git .DetectAppName (c .ControllerURL .Host )
221+ appID , err = git .DetectAppName (s . Client .ControllerURL .Host )
222222
223223 if err != nil {
224224 return err
@@ -244,7 +244,7 @@ func AppDestroy(appID, confirm string) error {
244244 startTime := time .Now ()
245245 fmt .Printf ("Destroying %s...\n " , appID )
246246
247- if err = apps .Delete (c , appID ); checkAPICompatibility (c , err ) != nil {
247+ if err = apps .Delete (s . Client , appID ); checkAPICompatibility (s . Client , err ) != nil {
248248 return err
249249 }
250250
@@ -259,16 +259,16 @@ func AppDestroy(appID, confirm string) error {
259259
260260// AppTransfer transfers app ownership to another user.
261261func AppTransfer (appID , username string ) error {
262- c , appID , err := load (appID )
262+ s , appID , err := load (appID )
263263
264264 if err != nil {
265265 return err
266266 }
267267
268268 fmt .Printf ("Transferring %s to %s... " , appID , username )
269269
270- err = apps .Transfer (c , appID , username )
271- if checkAPICompatibility (c , err ) != nil {
270+ err = apps .Transfer (s . Client , appID , username )
271+ if checkAPICompatibility (s . Client , err ) != nil {
272272 return err
273273 }
274274
0 commit comments