| 1 | // |
| 2 | // Copyright (c) SAS Institute Inc. |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | package main |
| 18 | |
| 19 | // Commands and signers for the basic client only (pure Go, all OSes) |
| 20 | |
| 21 | import ( |
| 22 | "runtime/debug" |
| 23 | "strings" |
| 24 | |
| 25 | "github.com/sassoftware/relic/v7/cmdline/shared" |
| 26 | "github.com/sassoftware/relic/v7/config" |
| 27 | |
| 28 | _ "github.com/sassoftware/relic/v7/cmdline/remotecmd" |
| 29 | _ "github.com/sassoftware/relic/v7/cmdline/verify" |
| 30 | |
| 31 | _ "github.com/sassoftware/relic/v7/signers/apk" |
| 32 | _ "github.com/sassoftware/relic/v7/signers/appmanifest" |
| 33 | _ "github.com/sassoftware/relic/v7/signers/appx" |
| 34 | _ "github.com/sassoftware/relic/v7/signers/cab" |
| 35 | _ "github.com/sassoftware/relic/v7/signers/cat" |
| 36 | _ "github.com/sassoftware/relic/v7/signers/cosign" |
| 37 | _ "github.com/sassoftware/relic/v7/signers/deb" |
| 38 | _ "github.com/sassoftware/relic/v7/signers/dmg" |
| 39 | _ "github.com/sassoftware/relic/v7/signers/jar" |
| 40 | _ "github.com/sassoftware/relic/v7/signers/macho" |
| 41 | _ "github.com/sassoftware/relic/v7/signers/msi" |
| 42 | _ "github.com/sassoftware/relic/v7/signers/pecoff" |
| 43 | _ "github.com/sassoftware/relic/v7/signers/pgp" |
| 44 | _ "github.com/sassoftware/relic/v7/signers/pkcs" |
| 45 | _ "github.com/sassoftware/relic/v7/signers/ps" |
| 46 | _ "github.com/sassoftware/relic/v7/signers/rpm" |
| 47 | _ "github.com/sassoftware/relic/v7/signers/vsix" |
| 48 | _ "github.com/sassoftware/relic/v7/signers/xap" |
| 49 | _ "github.com/sassoftware/relic/v7/signers/xar" |
| 50 | ) |
| 51 | |
| 52 | var ( |
| 53 | version = "unknown" // set this at link time |
| 54 | commit = "unknown" // set this at link time |
| 55 | ) |
| 56 | |
| 57 | func main() { |
| 58 | if version != "unknown" { |
| 59 | // normal CI compilation path |
| 60 | config.Version = version |
| 61 | config.Commit = commit |
| 62 | } else if bi, ok := debug.ReadBuildInfo(); ok { |
| 63 | // built from go module with `go install` |
| 64 | if strings.HasPrefix(bi.Main.Version, "v") { |
| 65 | config.Version = bi.Main.Version |
| 66 | config.Commit = bi.Main.Sum |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | config.UserAgent = "relic/" + config.Version |
| 71 | shared.Main() |
| 72 | } |