1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

Integrated scripts task

This commit is contained in:
Thomas Boerger 2015-08-27 10:57:17 +02:00
parent c2346e3275
commit ab44a65e81

40
make.go
View File

@ -64,7 +64,45 @@ func embed() error {
// scripts step concatinates all javascript files.
func scripts() error {
// concatinate scripts
files := []string{
"cmd/drone-server/static/scripts/term.js",
"cmd/drone-server/static/scripts/drone.js",
"cmd/drone-server/static/scripts/controllers/repos.js",
"cmd/drone-server/static/scripts/controllers/builds.js",
"cmd/drone-server/static/scripts/controllers/users.js",
"cmd/drone-server/static/scripts/services/repos.js",
"cmd/drone-server/static/scripts/services/builds.js",
"cmd/drone-server/static/scripts/services/users.js",
"cmd/drone-server/static/scripts/services/logs.js",
"cmd/drone-server/static/scripts/services/tokens.js",
"cmd/drone-server/static/scripts/services/feed.js",
"cmd/drone-server/static/scripts/filters/filter.js",
"cmd/drone-server/static/scripts/filters/gravatar.js",
"cmd/drone-server/static/scripts/filters/time.js",
}
f, err := os.OpenFile(
"cmd/drone-server/static/scripts/drone.min.js",
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
}