From ca4fc587c368e5a4f85a6514b9fd5e00153847ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 5 Nov 2024 09:57:12 +0100 Subject: [PATCH] common/hugo: Add withdeploy to the version string printed in hugo version --- common/hugo/vars_withdeploy.go | 19 +++++++++++++++++++ common/hugo/vars_withdeploy_off.go | 19 +++++++++++++++++++ common/hugo/version.go | 3 +++ 3 files changed, 41 insertions(+) create mode 100644 common/hugo/vars_withdeploy.go create mode 100644 common/hugo/vars_withdeploy_off.go diff --git a/common/hugo/vars_withdeploy.go b/common/hugo/vars_withdeploy.go new file mode 100644 index 000000000..88ce9a1cd --- /dev/null +++ b/common/hugo/vars_withdeploy.go @@ -0,0 +1,19 @@ +// Copyright 2024 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build withdeploy +// +build withdeploy + +package hugo + +var IsWithdeploy = true diff --git a/common/hugo/vars_withdeploy_off.go b/common/hugo/vars_withdeploy_off.go new file mode 100644 index 000000000..935568027 --- /dev/null +++ b/common/hugo/vars_withdeploy_off.go @@ -0,0 +1,19 @@ +// Copyright 2024 The Hugo Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !withdeploy +// +build !withdeploy + +package hugo + +var IsWithdeploy = false diff --git a/common/hugo/version.go b/common/hugo/version.go index 6cabfdbb9..cf5988840 100644 --- a/common/hugo/version.go +++ b/common/hugo/version.go @@ -152,6 +152,9 @@ func BuildVersionString() string { if IsExtended { version += "+extended" } + if IsWithdeploy { + version += "+withdeploy" + } osArch := bi.GoOS + "/" + bi.GoArch