-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
47 lines (37 loc) · 996 Bytes
/
index.js
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
38
39
40
41
42
43
44
45
46
47
'use strict';
var path = require('path');
var fs = require('fs');
function DraggableEach(project) {
this.project = project;
this.name = 'draggable-each';
}
function unwatchedTree(dir) {
return {
read: function() { return dir; },
cleanup: function() { }
};
}
DraggableEach.prototype.treeFor = function treeFor(name) {
var treePath;
if(name === 'bower_components') {
treePath = path.join(__dirname, 'bower_components');
if (fs.existsSync(treePath)) {
return unwatchedTree(treePath);
}
}else if(name === 'app'){
treePath = path.join(__dirname, 'app');
var tree;
if (fs.existsSync(treePath)) {
if (process.env.EMBER_ADDON_ENV === 'development') {
tree = treePath;
} else {
tree = unwatchedTree(treePath);
}
}
return tree;
}
};
DraggableEach.prototype.included = function(app){
app.import('bower_components/jquery-ui-sortable/jquery-ui-sortable.js');
}
module.exports = DraggableEach;