forked from markmiscavage/scarlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
53 lines (40 loc) · 1.12 KB
/
Gruntfile.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
53
/* jshint node: true */
module.exports = function (grunt) {
"use strict";
var path = require("path"),
cwd = process.cwd();
// Project configuration.
grunt.initConfig({
meta: {
projectName: "scarlet",
projectTitle: "Scarlet"
}
});
// Load grunt-contrib tasks
grunt.loadNpmTasks("grunt-contrib-watch");
// 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 + path.sep, "");
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);
grunt.loadTasks(tasks);
// 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);
}
}());
};