-
Notifications
You must be signed in to change notification settings - Fork 46
/
version.go
43 lines (36 loc) · 882 Bytes
/
version.go
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
package main
import (
"fmt"
"log"
"github.com/cubicdaiya/nginx-build/builder"
)
func versionsGenNginx() []string {
return []string{
fmt.Sprintf("nginx-%s", builder.NginxVersion),
}
}
func versionsGenOpenResty() []string {
return []string{
fmt.Sprintf("openresty-%s", builder.OpenRestyVersion),
}
}
func versionsGenFreenginx() []string {
return []string{
fmt.Sprintf("freenginx-%s", builder.FreenginxVersion),
}
}
func printNginxVersions() {
var versions []string
versions = append(versions, versionsGenNginx()...)
versions = append(versions, versionsGenOpenResty()...)
versions = append(versions, versionsGenFreenginx()...)
for _, v := range versions {
fmt.Println(v)
}
}
func versionCheck(version string) {
if len(version) == 0 {
log.Println("[warn]nginx version is not set.")
log.Printf("[warn]nginx-build use %s.\n", builder.NginxVersion)
}
}