-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrunt.js
52 lines (40 loc) · 1.11 KB
/
grunt.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
48
49
50
51
52
/*jshint node:true*/
module.exports = function (grunt) {
"use strict";
var path = require("path"),
cwd = process.cwd();
// Project configuration.
grunt.initConfig({
meta: {
projectName: "logo",
projectTitle: "RED Canvas Logo"
}
});
// Robin tasks
// Load your custom tasks *after* these
(function () {
var fs = require("fs");
var dir = path.join(cwd, ".robyn"),
files = grunt.file.expand(path.join(dir, "*"));
if (!files.length) {
var d = dir.replace(cwd + "/", "");
var warn = [
"%s is not yet initialized".replace("%s", d),
"Run `git submodule update --init .robyn`",
"Then try this command again."
].join("\n ").trim();
grunt.fail.warn(warn);
}
var robynPkg = require(path.join(dir, "package.json")),
tasks = path.join(dir, robynPkg.config.dirs.tasks),
helpers = path.join(tasks, "helpers");
grunt.loadTasks(tasks);
grunt.loadTasks(helpers);
// Customize path in robyn.json
var pkg = require(path.join(cwd, "robyn.json")),
local = path.join(cwd, pkg.config.dirs.tasks);
if (fs.existsSync(local)) {
grunt.loadTasks(local);
}
}());
};