-
Notifications
You must be signed in to change notification settings - Fork 7
/
make.js
executable file
·90 lines (73 loc) · 2 KB
/
make.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env node
var CSSLINT = './node_modules/csslint/cli.js',
CSS_DIR = 'css',
SLICE = Array.prototype.slice;
require('shelljs/make');
function checkCSS() {
echo('### Linting CSS files');
var dirs = SLICE.call( arguments ).join( ' ' );
// see cli.js --list-rules.
var warnings = [
// "important",
// "adjoining-classes",
// "duplicate-background-images",
// "qualified-headings",
// "fallback-colors",
// "empty-rules",
// "shorthand",
// "overqualified-elements",
// "import",
// "regex-selectors",
// "rules-count",
// "font-sizes",
// "universal-selector",
// "unqualified-attributes",
"zero-units"
].join(",");
var errors = [
"known-properties",
"compatible-vendor-prefixes",
"display-property-grouping",
"duplicate-properties",
"errors",
"gradients",
"font-faces",
"floats",
"vendor-prefix"
].join(",");
exec(CSSLINT + ' --warnings=' + warnings +
' --errors=' + errors +
' --quiet --format=compact' +
' ' + dirs);
}
target.check = function() {
checkCSS( CSS_DIR );
};
target.storycamp = function(){
echo('### Creating complete Storycamp + Butter site in dist/');
var cwd = pwd();
// Clean
rm('-fr', 'dist');
// Update submodule
exec('git submodule update --init --recursive');
// Make sure npm is in butter/ submodule
cd('butter');
exec('npm install');
// Run storycamp target in butter
exec('node make storycamp');
// Copy butter dist/ to storycamp dist/
cp('-R', 'dist/', cwd);
// Create storycamp static content in dist
cd(cwd);
mkdir('dist/storycamp');
cp('-R', 'css/', 'dist/storycamp');
cp('-R', 'docs/', 'dist/storycamp');
cp('-R', 'img/', 'dist/storycamp');
cp('-R', 'js/', 'dist/storycamp');
cp('-R', 'pop-images/', 'dist/storycamp');
cp('-R', 'sounds', 'dist/storycamp');
cp('cinema*', 'dist/storycamp');
cp('index.html', 'dist/storycamp');
// Copy maker site to dist/
cp('-R', 'maker/*', 'dist');
};