X-Git-Url: https://jasonwoof.com/gitweb/?p=af-coffee.git;a=blobdiff_plain;f=client.coffee;h=b3956050d1a603caeb916cbd840bc8b515d0cd09;hp=9e28b9b09f14d0de7c53cbf0103d6af417a13db2;hb=3a8d93b745943367320bb0e738e9cc0b230fe0a1;hpb=4b25ae43b769543dc9cb4c1c43178f9d43eb095f diff --git a/client.coffee b/client.coffee index 9e28b9b..b395605 100755 --- a/client.coffee +++ b/client.coffee @@ -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