From 2e819a360c3ef49c2dc69fe2d1521ea823330a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=9C=C9=B4=E1=B4=8B=C9=B4=E1=B4=A1=E1=B4=8F=C9=B4?= Date: Thu, 20 Feb 2020 16:33:03 +0800 Subject: [PATCH] build: rename build tag miniwinsvc -> minwinsvc This was in fact a typo. --- CHANGELOG.md | 1 + appveyor.yml | 2 +- internal/route/install.go | 2 +- internal/setting/computed.go | 12 ++++++++++++ .../setting/{miniwinsvc.go => computed_minwinsvc.go} | 4 ++-- internal/setting/setting.go | 1 - 6 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 internal/setting/computed.go rename internal/setting/{miniwinsvc.go => computed_minwinsvc.go} (82%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c77c23df..ff2774cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to Gogs are documented in this file. - All assets are now embedded into binary and served from memory by default. Set `[server] LOAD_ASSETS_FROM_DISK = true` to load them from disk. [#5920](https://github.com/gogs/gogs/pull/5920) - Application and Go versions are removed from page footer and only show in the admin dashboard. +- Build tag for running as Windows Service has been changed from `miniwinsvc` to `minwinsvc`. ### Fixed diff --git a/appveyor.yml b/appveyor.yml index 9a57c21cf..e1169985c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,4 +13,4 @@ deploy: false install: - go version - go env - - go build -v + - go build -tags "minwinsvc" -v diff --git a/internal/route/install.go b/internal/route/install.go index bd51711ec..c145fc0ba 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 000000000..7bdee0533 --- /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/miniwinsvc.go b/internal/setting/computed_minwinsvc.go similarity index 82% rename from internal/setting/miniwinsvc.go rename to internal/setting/computed_minwinsvc.go index a7c6890d1..27d0ce875 100644 --- a/internal/setting/miniwinsvc.go +++ b/internal/setting/computed_minwinsvc.go @@ -1,4 +1,4 @@ -// +build miniwinsvc +// +build minwinsvc // Copyright 2015 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style @@ -11,5 +11,5 @@ import ( ) func init() { - SupportMiniWinService = true + supportWindowsService = true } diff --git a/internal/setting/setting.go b/internal/setting/setting.go index fd8d14c0d..b95ddbe32 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