summaryrefslogtreecommitdiffstats
path: root/cmd/commands/license.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-17 12:40:40 -0700
committerGitHub <noreply@github.com>2018-05-17 12:40:40 -0700
commit11cbb597471127c1b29e78e6cad0a1a4d93ea24c (patch)
tree0eceb950872c7234348f0b41d4492073908840d0 /cmd/commands/license.go
parent1f6c271b3bedd6656ae7155714423b1b39a669c1 (diff)
downloadchat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.tar.gz
chat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.tar.bz2
chat-11cbb597471127c1b29e78e6cad0a1a4d93ea24c.zip
Renaming platform binary to mattermost. (#8801)
Diffstat (limited to 'cmd/commands/license.go')
-rw-r--r--cmd/commands/license.go55
1 files changed, 0 insertions, 55 deletions
diff --git a/cmd/commands/license.go b/cmd/commands/license.go
deleted file mode 100644
index 61c8e3060..000000000
--- a/cmd/commands/license.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-package commands
-
-import (
- "errors"
- "io/ioutil"
-
- "github.com/mattermost/mattermost-server/cmd"
- "github.com/spf13/cobra"
-)
-
-var LicenseCmd = &cobra.Command{
- Use: "license",
- Short: "Licensing commands",
-}
-
-var UploadLicenseCmd = &cobra.Command{
- Use: "upload [license]",
- Short: "Upload a license.",
- Long: "Upload a license. Replaces current license.",
- Example: " license upload /path/to/license/mylicensefile.mattermost-license",
- RunE: uploadLicenseCmdF,
-}
-
-func init() {
- LicenseCmd.AddCommand(UploadLicenseCmd)
- cmd.RootCmd.AddCommand(LicenseCmd)
-}
-
-func uploadLicenseCmdF(command *cobra.Command, args []string) error {
- a, err := cmd.InitDBCommandContextCobra(command)
- if err != nil {
- return err
- }
- defer a.Shutdown()
-
- if len(args) != 1 {
- return errors.New("Enter one license file to upload")
- }
-
- var fileBytes []byte
- if fileBytes, err = ioutil.ReadFile(args[0]); err != nil {
- return err
- }
-
- if _, err := a.SaveLicense(fileBytes); err != nil {
- return err
- }
-
- cmd.CommandPrettyPrintln("Uploaded license file")
-
- return nil
-}