Skip to content

Commit

Permalink
Integrated styles task
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Boerger committed Aug 27, 2015
1 parent 7e21566 commit c2346e3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ drone.sublime-workspace
*.rice-box.go
*.db
*.txt
*.min.css
*.min.js
*_bindata.go
*.toml
Expand Down
39 changes: 36 additions & 3 deletions make.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -67,10 +68,42 @@ func scripts() error {
return nil
}

// styles step concatinates the css files.
// styles step concatinates the stylesheet files.
func styles() error {
// concatinate styles
// inject css variables?
files := []string{
"cmd/drone-server/static/styles/reset.css",
"cmd/drone-server/static/styles/fonts.css",
"cmd/drone-server/static/styles/alert.css",
"cmd/drone-server/static/styles/blankslate.css",
"cmd/drone-server/static/styles/list.css",
"cmd/drone-server/static/styles/label.css",
"cmd/drone-server/static/styles/range.css",
"cmd/drone-server/static/styles/switch.css",
"cmd/drone-server/static/styles/main.css",
}

f, err := os.OpenFile(
"cmd/drone-server/static/styles/drone.min.css",
os.O_CREATE|os.O_RDWR|os.O_TRUNC,
0660)

defer f.Close()

if err != nil {
fmt.Println("Failed to open output file")
return err
}

for _, input := range files {
content, err := ioutil.ReadFile(input)

if err != nil {
return err
}

f.Write(content)
}

return nil
}

Expand Down

0 comments on commit c2346e3

Please sign in to comment.