forked from greneholt/youtube5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.coffee
executable file
·54 lines (43 loc) · 1.44 KB
/
build.coffee
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
#!/usr/bin/env coffee
async = require 'async'
b = require './buildutils'
task = process.argv[2]
callback = (err) ->
throw err if err
if task is 'safari'
async.series [
(cb) ->
b.mkdirRecursive 'build/YouTube5.safariextension', cb
(cb) ->
async.parallel [
(cb) ->
b.compile '{src/{util,player,inject}.coffee,safari/inject.coffee}', 'build/YouTube5.safariextension/inject.js', cb
(cb) ->
b.compile '{src/{util,main,providers/*}.coffee,safari/main.coffee}', 'build/YouTube5.safariextension/main.js', cb
(cb) ->
b.globCopy 'assets/*', 'build/YouTube5.safariextension', cb
(cb) ->
b.globCopy 'safari/*.{html,plist}', 'build/YouTube5.safariextension', cb
], cb
], callback
else if task is 'safariback'
b.globCopy 'build/YouTube5.safariextension/*.plist', 'safari', callback
else if task is 'chrome'
async.series [
(cb) ->
b.mkdirRecursive 'build/chrome', cb
(cb) ->
async.parallel [
(cb) ->
b.compile '{src/*.coffee,src/providers/*.coffee,chrome/inject.coffee}', 'build/chrome/inject.js', cb
(cb) ->
b.globCopy 'assets/*', 'build/chrome', cb
(cb) ->
b.globCopy 'chrome/manifest.json', 'build/chrome', cb
], cb
], callback
else if task is 'clean'
b.globRm 'build/YouTube5.safariextension/*', callback
b.globRm 'build/chrome/*', callback
else
console.log 'No task specified'