forked from ionic-team/ionic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.js
More file actions
37 lines (31 loc) · 939 Bytes
/
upload.js
File metadata and controls
37 lines (31 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var IonicAppLib = require('ionic-app-lib'),
IonicLoginTask = require('./login').IonicTask,
IonicStats = require('./stats').IonicStats,
Login = IonicAppLib.login,
LoginTask = require('./login'),
Task = require('./task').Task,
Upload = IonicAppLib.upload,
Utils = IonicAppLib.utils;
var IonicTask = function() {};
IonicTask.prototype = new Task();
IonicTask.prototype.run = function run(ionic, argv) {
var note = argv.note;
var deploy = argv.deploy || false;
IonicStats.t();
return Login.retrieveLogin()
.then(function(jar){
if (!jar) {
console.log('No previous login existed. Attempting to log in now.');
return LoginTask.login(argv);
}
return jar;
})
.then(function(jar) {
return Upload.doUpload(process.cwd(), jar, note, deploy);
})
.catch(function(ex) {
// console.log('Error', ex, ex.stack);
Utils.fail(ex);
});
};
exports.IonicTask = IonicTask;