- push: (cb) => @api 'app_update_files', new_app, zip_file, cb
- # TODO find out if app_update_files increments app_info.version
- # 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 ]
- copy_uris: ['push', 'old_info', 'new_info', (cb, args) =>
+ info1: (cb) => @api 'app_info', app_name, cb
+ info2: (cb) => @api 'app_info', app_name + '_', cb
+ infos: ['info1', 'info2', (cb, args) ->
+ # FIXME check for other requirements and bail if not met
+ if args.info1.state is 'STOPPED'
+ cb null, new: args.info1, old: args.info2
+ else
+ cb null, new: args.info2, old: args.info1
+ ]
+ push: ['infos', (cb, args) =>
+ @api 'app_update_files', args.infos.new.name, zip_file, cb
+ ]
+ copy_uris: ['push', 'infos', (cb, args) =>