Path: blob/main/components/local-app/pkg/constants/constants.go
2500 views
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package constants56import (7_ "embed"8"fmt"9"strconv"10"strings"11"time"1213"github.com/Masterminds/semver/v3"14version "github.com/gitpod-io/local-app"15)1617var (18// Version is fed from the main CLI version19Version = semver.MustParse(strings.TrimSpace(version.Version))2021// GitCommit - set during build22GitCommit = "unknown"2324// BuildTime - set during build25BuildTime = "unknown"26)2728// MustParseBuildTime parses the build time or panics29func MustParseBuildTime() time.Time {30if BuildTime == "unknown" {31return time.Time{}32}3334sec, err := strconv.ParseInt(BuildTime, 10, 64)35if err != nil {36panic(fmt.Sprintf("cannot parse build time: %v", err))37}38return time.Unix(sec, 0)39}404142