forked from pogopaule/ember-cli-spinkit
/
index.js
30 lines (28 loc) · 912 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
/* jshint node: true */
'use strict';
var path = require('path');
var fs = require('fs');
var chalk = require('chalk');
module.exports = {
name: 'ember-spinkit',
blueprintsPath: function() {
return __dirname + '/blueprints';
},
included: function(app) {
var cssPath = 'vendor/ember-spinkit/styles/';
if(fs.existsSync(cssPath)) {
var files = fs.readdirSync(cssPath);
files.forEach(function(file) {
app.import(cssPath + file);
});
} else {
console.warn(chalk.yellow("You have installed ember-spinkit but you didn't run 'ember generate spinkit-<name of spinner>' yet. See https://github.com/pogopaule/ember-cli-spinkit for more information."));
}
},
treeForTemplates: function() {
var treePath = path.join('vendor', 'ember-cli-spinkit', 'templates');
if (fs.existsSync(treePath)) {
return this.treeGenerator(treePath);
}
},
};