cert_stub.go 662 B

1234567891011121314151617181920212223242526272829
  1. // +build !cert
  2. // Copyright 2009 The Go Authors. All rights reserved.
  3. // Copyright 2014 The Gogs Authors. All rights reserved.
  4. // Use of this source code is governed by a MIT-style
  5. // license that can be found in the LICENSE file.
  6. package cmd
  7. import (
  8. "fmt"
  9. "os"
  10. "github.com/urfave/cli"
  11. )
  12. var Cert = cli.Command{
  13. Name: "cert",
  14. Usage: "Generate self-signed certificate",
  15. Description: `Please use build tags "cert" to rebuild Gogs in order to have this ability`,
  16. Action: runCert,
  17. }
  18. func runCert(ctx *cli.Context) error {
  19. fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
  20. os.Exit(1)
  21. return nil
  22. }