var fs = require('fs'),
    path = require('path'),
    cheerio = require('cheerio'),
    request = require('request'),
    parseUrl = require('url').parse,
    archiver = require('archiver'),
    argv = require('optimist').argv,
    FormData = require('form-data'),
    IonicProject = require('./project'),
    Task = require('./task').Task,
    IonicAppLib = require('ionic-app-lib'),
    Utils = IonicAppLib.utils,
    Login = IonicAppLib.login,
    LoginTask = require('./login'),
    Upload = IonicAppLib.upload,
    IonicStats = require('./stats').IonicStats,
    IonicLoginTask = require('./login').IonicTask,
    IonicUtils = require('./utils');

var IonicTask = function() {};

IonicTask.prototype = new Task();

IonicTask.prototype.run = function run(ionic, argv) {
  var note = argv.note;

  IonicStats.t();

  return Login.retrieveLogin()
  .then(function(jar){
    if (!jar) {
      console.log('No previous login existed. Attempting to log in now.');
      return LoginTask.login();
    }
    return jar;
  })
  .then(function(jar) {
    return Upload.doUpload(process.cwd(), jar, note);
  })
  .catch(function(ex) {
    // console.log('Error', ex, ex.stack);
    Utils.fail(ex);
  });
};

exports.IonicTask = IonicTask;

@@ -1,320 +1,113 @@
 var 
-fs = require('fs'),%0A    path = require('path'),%0A    cheerio = require('cheerio'),%0A    request = require('request'),%0A    parseUrl = require('url').parse,%0A    archiver = require('archiver'),%0A    argv = require('optimist').argv,%0A    FormData = require('form-data'),%0A    IonicProject = require('./project'),%0A    Task
+IonicAppLib = require('ionic-app-lib'),%0A    IonicLoginTask = require('./login').IonicTask,%0A    IonicStats
  = r
@@ -120,93 +120,25 @@
 ('./
+s
 ta
+t
 s
-k
 ').
-Task,%0A    IonicAppLib = require('ionic-app-lib'),%0A    Utils = IonicAppLib.util
+IonicStat
 s,%0A 
@@ -211,51 +211,12 @@
     
-Upload = IonicAppLib.upload,%0A    IonicStats
+Task
  = r
@@ -229,96 +229,66 @@
 ('./
-s
 ta
-t
 s
+k
 ').
-IonicStats,%0A    IonicLoginTask = require('./login').IonicTask
+Task,%0A    Upload = IonicAppLib.upload
 ,%0A    
-Ionic
 Utils = 
 requ
@@ -287,26 +287,25 @@
 s = 
-require('./
+IonicAppLib.
 utils
-')
 ;%0A%0Av

Remove unused variables