mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-03 14:18:42 +00:00
Integrated styles task
This commit is contained in:
parent
7e21566af3
commit
c2346e3275
2 changed files with 37 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -14,6 +14,7 @@ drone.sublime-workspace
|
||||||
*.rice-box.go
|
*.rice-box.go
|
||||||
*.db
|
*.db
|
||||||
*.txt
|
*.txt
|
||||||
|
*.min.css
|
||||||
*.min.js
|
*.min.js
|
||||||
*_bindata.go
|
*_bindata.go
|
||||||
*.toml
|
*.toml
|
||||||
|
|
39
make.go
39
make.go
|
@ -9,6 +9,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -67,10 +68,42 @@ func scripts() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// styles step concatinates the css files.
|
// styles step concatinates the stylesheet files.
|
||||||
func styles() error {
|
func styles() error {
|
||||||
// concatinate styles
|
files := []string{
|
||||||
// inject css variables?
|
"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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue