From 2e819a360c3ef49c2dc69fe2d1521ea823330a1f Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Thu, 20 Feb 2020 16:33:03 +0800 Subject: build: rename build tag miniwinsvc -> minwinsvc This was in fact a typo. --- internal/route/install.go | 2 +- internal/setting/computed.go | 12 ++++++++++++ internal/setting/computed_minwinsvc.go | 15 +++++++++++++++ internal/setting/miniwinsvc.go | 15 --------------- internal/setting/setting.go | 1 - 5 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 internal/setting/computed.go create mode 100644 internal/setting/computed_minwinsvc.go delete mode 100644 internal/setting/miniwinsvc.go (limited to 'internal') diff --git a/internal/route/install.go b/internal/route/install.go index bd51711e..c145fc0b 100644 --- a/internal/route/install.go +++ b/internal/route/install.go @@ -81,7 +81,7 @@ func GlobalInit() { if db.EnableSQLite3 { log.Info("SQLite3 is supported") } - if setting.SupportMiniWinService { + if setting.SupportWindowsService() { log.Info("Builtin Windows Service is supported") } if setting.LoadAssetsFromDisk { diff --git a/internal/setting/computed.go b/internal/setting/computed.go new file mode 100644 index 00000000..7bdee053 --- /dev/null +++ b/internal/setting/computed.go @@ -0,0 +1,12 @@ +// Copyright 2020 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package setting + +var supportWindowsService bool + +// SupportWindowsService returns true if running as Windows Service is supported. +func SupportWindowsService() bool { + return supportWindowsService +} diff --git a/internal/setting/computed_minwinsvc.go b/internal/setting/computed_minwinsvc.go new file mode 100644 index 00000000..27d0ce87 --- /dev/null +++ b/internal/setting/computed_minwinsvc.go @@ -0,0 +1,15 @@ +// +build minwinsvc + +// Copyright 2015 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package setting + +import ( + _ "github.com/gogs/minwinsvc" +) + +func init() { + supportWindowsService = true +} diff --git a/internal/setting/miniwinsvc.go b/internal/setting/miniwinsvc.go deleted file mode 100644 index a7c6890d..00000000 --- a/internal/setting/miniwinsvc.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build miniwinsvc - -// Copyright 2015 The Gogs Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package setting - -import ( - _ "github.com/gogs/minwinsvc" -) - -func init() { - SupportMiniWinService = true -} diff --git a/internal/setting/setting.go b/internal/setting/setting.go index fd8d14c0..b95ddbe3 100644 --- a/internal/setting/setting.go +++ b/internal/setting/setting.go @@ -314,7 +314,6 @@ var ( // Other settings ShowFooterBranding bool ShowFooterTemplateLoadTime bool - SupportMiniWinService bool // Global setting objects Cfg *ini.File -- cgit v1.2.3