JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
work around server bug to fix publish_seamless
authorJason Woofenden <jason@jasonwoof.com>
Wed, 13 Feb 2013 17:19:11 +0000 (12:19 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 13 Feb 2013 17:19:11 +0000 (12:19 -0500)
client.coffee

index 9e28b9b..b395605 100755 (executable)
@@ -59,12 +59,20 @@ commands.app_publish_seamless = (token, app_name, zip_file, callback) ->
                # if not, drop new_info's dependency on push
                old_info: (cb) => @api 'app_info', old_app, cb
                new_info: ['push', (cb) => @api 'app_info', new_app, cb ]
-               start_new: ['push', 'old_info', 'new_info', (cb, args) =>
-                       args.new_info.state = 'STARTED'
+               copy_uris: ['push', 'old_info', 'new_info', (cb, args) =>
+                       # There's a bug in the server where you can't set new uris and
+                       # start the app in the same app_set_info call
                        for u in args.old_info.uris
                                args.new_info.uris.push u unless u.substr(-6) is '.af.cm'
                        @api 'app_set_info', new_app, args.new_info, cb
                ]
+               new_info_again: ['copy_uris', (cb, args) =>
+                       @api 'app_info', new_app, cb
+               ]
+               start_new: ['new_info_again', (cb, args) =>
+                       args.new_info_again.state = 'STARTED'
+                       @api 'app_set_info', new_app, args.new_info_again, cb
+               ]
                hide_old: ['start_new', 'old_info', (cb, args) =>
                        just_af = []
                        for u in args.old_info.uris