Skip to content

Commit a48e7b9

Browse files
committed
feat(setup): deprecate setup task
**BREAKING CHANGE**: the setup task is deprecated in favor of using gulp hooks.
1 parent 5fe8ffb commit a48e7b9

File tree

1 file changed

+4
-63
lines changed

1 file changed

+4
-63
lines changed

lib/ionic/setup.js

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,12 @@
1-
var Task = require('./task').Task,
2-
fs = require('fs'),
3-
path = require('path'),
4-
argv = require('optimist').argv,
5-
exec = require('child_process').exec,
6-
Q = require('q'),
7-
IonicProject = require('./project'),
8-
IonicAppLib = require('ionic-app-lib'),
9-
Setup = IonicAppLib.setup,
10-
Utils = IonicAppLib.utils,
11-
colors = require('colors');
1+
var Task = require('./task').Task;
122

133
var IonicTask = function() {};
144

155
IonicTask.prototype = new Task();
166

17-
IonicTask.prototype.run = function(ionic) {
18-
if( argv._.length < 2 ) {
19-
return ionic.fail('Missing setup task command.', 'setup');
20-
}
21-
22-
var self = this;
23-
var tasks = argv._.slice(1);
24-
var promises = [];
25-
26-
var promise = Q();
27-
28-
for (var x = 0; x < tasks.length; x++) {
29-
try {
30-
(function() {
31-
//create closure for task
32-
var task = self.runSetupTask(tasks[x]);
33-
// console.log('Task: ', task);
34-
promises.push(task);
35-
})();
36-
} catch (ex) {
37-
38-
}
39-
}
40-
41-
promises.forEach(function(task) {
42-
// console.log('Task foreach:', task);
43-
promise = promise.then(function(){ return task(process.cwd()); });
44-
});
45-
46-
promise
47-
.fin(function() {
48-
console.log('Ionic setup complete'.green.bold);
49-
})
50-
.catch(function(error) {
51-
console.log('Error from setup - ' + error);
52-
});
53-
54-
};
55-
56-
IonicTask.prototype.runSetupTask = function runSetupTask(setupTask) {
57-
switch (setupTask) {
58-
case 'sass':
59-
return Setup.sassSetup;
60-
break;
61-
case 'facebook':
62-
return Setup.setupFacebook;
63-
break;
64-
default:
65-
var errorMessage = 'Invalid setup task command: ' + setupTask;
66-
console.log(errorMessage);
67-
return Q(errorMessage);
68-
}
7+
IonicTask.prototype.run = function() {
8+
//TODO link to gulp hook docs
9+
console.log('The setup task has been deprecated.\n');
6910
};
7011

7112
exports.IonicTask = IonicTask;

0 commit comments

Comments
 (0)