var Promise   = require('../../lib/ext/promise');

module.exports = {
  description: 'Generates a relative proxy to another server.',

  anonymousOptions: [
    'local-path',
    'remote-url'
  ],

  locals: function(options) {
    var proxyUrl = options.args[2];
    return {
      path: '/' + options.entity.name.replace(/^\//, ''),
      proxyUrl: proxyUrl
    };
  },

  afterInstall: function() {
    return Promise.all([
      this.addPackageToProject('http-proxy', '^1.1.6'),
      this.addPackageToProject('morgan', '^1.3.2'),
      this.addPackageToProject('connect-restreamer', '^1.0.0')
    ]);
  }
};

@@ -410,28 +410,8 @@
 urn 
-Promise.all(%5B%0A      
 this
@@ -413,32 +413,33 @@
  this.addPackage
+s
 ToProject('http-
@@ -432,16 +432,32 @@
 Project(
+%5B%0A      %7B name: 
 'http-pr
@@ -461,16 +461,24 @@
 -proxy',
+ target:
  '%5E1.1.6
@@ -478,25 +478,26 @@
 '%5E1.1.6'
-)
+ %7D
 ,%0A      
 this.add
@@ -492,33 +492,16 @@
     
-this.addPackageToProject(
+%7B name: 
 'mor
@@ -505,16 +505,24 @@
 morgan',
+ target:
  '%5E1.3.2
@@ -522,25 +522,26 @@
 '%5E1.3.2'
-)
+ %7D
 ,%0A      
 this.add
@@ -536,33 +536,16 @@
     
-this.addPackageToProject(
+%7B name: 
 'con
@@ -561,16 +561,24 @@
 reamer',
+ target:
  '%5E1.0.0
@@ -578,17 +578,18 @@
 '%5E1.0.0'
-)
+ %7D
 %0A    %5D);

use addPackagesToProject instead of addPackageToProject in a Promise.all