cert_stub.go 759 B

123456789101112131415161718192021222324252627282930313233
  1. // +build !cert
  2. // Copyright 2015 - Present, The Gogs Authors. All rights reserved.
  3. // Copyright 2018 - Present, Gitote. All rights reserved.
  4. //
  5. // This source code is licensed under the MIT license found in the
  6. // LICENSE file in the root directory of this source tree.
  7. package cmd
  8. import (
  9. "fmt"
  10. "os"
  11. "github.com/urfave/cli"
  12. )
  13. // Cert Initialize cert CLI
  14. var Cert = cli.Command{
  15. Name: "cert",
  16. Usage: "Generate self-signed certificate",
  17. Description: `Please use build tags "cert" to rebuild Gitote in order to have this ability`,
  18. Action: runCert,
  19. }
  20. // runCert builds cert CLI
  21. func runCert(ctx *cli.Context) error {
  22. fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
  23. os.Exit(1)
  24. return nil
  25. }