mirror of
https://github.com/octoleo/syncthing.git
synced 2024-09-19 21:29:01 +00:00
build: Allow easy influencing build user and build host
To facilitate reproducible builds.
This commit is contained in:
parent
d7cb4d407b
commit
24e2ce0764
8
build.go
8
build.go
@ -757,6 +757,10 @@ func buildStamp() int64 {
|
||||
}
|
||||
|
||||
func buildUser() string {
|
||||
if v := os.Getenv("BUILD_USER"); v != "" {
|
||||
return v
|
||||
}
|
||||
|
||||
u, err := user.Current()
|
||||
if err != nil {
|
||||
return "unknown-user"
|
||||
@ -765,6 +769,10 @@ func buildUser() string {
|
||||
}
|
||||
|
||||
func buildHost() string {
|
||||
if v := os.Getenv("BUILD_HOST"); v != "" {
|
||||
return v
|
||||
}
|
||||
|
||||
h, err := os.Hostname()
|
||||
if err != nil {
|
||||
return "unknown-host"
|
||||
|
Loading…
Reference in New Issue
Block a user