forked from 1j01/elementary.css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCakefile
55 lines (48 loc) · 1.73 KB
/
Cakefile
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
{writeFileSync, mkdirSync} = require "fs"
{join} = require "path"
postgtk = require "postcss-gtk"
autoprefixer = require "autoprefixer-core"
csswring = require "csswring"
task "build", ->
output_dir = "lib"
try mkdirSync output_dir
build = (to, {from})->
output_path = join output_dir, to
source_map_output_path = "#{output_path}.map"
entry_point_css = """
@import "./egtk/gtk-3.0/#{from}";
@import "./fixes.css";
"""
postgtk
.use autoprefixer browsers: ["> 1%"]
.use csswring
.process entry_point_css, to: output_path, map: inline: yes
.then (result)->
writeFileSync output_path, result.css, "utf8"
console.log "wrote #{output_path}"
.catch (e)->
console.error e.stack
build "elementary.css", from: "gtk.css"
build "elementary-dark.css", from: "gtk-dark.css"
request = require "request"
task "pull-latest", ->
launchpad_homepage = "https://launchpad.net/egtk"
request launchpad_homepage, (err, res, body)->
throw err if err
if res.statusCode is 200
m = body.match /<a href="([^"]*)"\s+title="(Source tarball)"/
if m?
[_, tarball_url, title] = m
console.log """
#{title} URL: #{tarball_url}
Download it yourself, and extract it to egtk/
You can use something like this if you can't extract a .tar.xz file: http://archive.online-convert.com/convert-to-zip
Comment out color: @transparent; in gtk-widgets.css
Fix missing commas in gtk-widgets.css and gtk-widgets-dark.css (GtkMessageDialog .titlebar:backdrop)
Then npm run prepublish
I'm probably the laziest script ever
"""
else
console.log "Tarball link not found on page #{launchpad_homepage}"
else
throw new Error "Request for #{launchpad_homepage} returned HTTP status code #{res.statusCode}"