summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-05-12 14:32:28 -0400
committerUnknwon <u@gogs.io>2016-05-12 14:32:28 -0400
commit7826eae452360913b7c9e476566dc30601270c75 (patch)
treec0062ef2ed630c280fc4919f6d645a1aee87aed6 /cmd
parent8a2347592d78548a54e35a71eb379ae3b8810bc6 (diff)
downloadgitea-7826eae452360913b7c9e476566dc30601270c75.tar.gz
gitea-7826eae452360913b7c9e476566dc30601270c75.zip
#3045 fix DEPRECATED Action signature erorr
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cert.go4
-rw-r--r--cmd/cert_stub.go4
-rw-r--r--cmd/dump.go14
-rw-r--r--cmd/serve.go8
-rw-r--r--cmd/update.go6
-rw-r--r--cmd/web.go4
6 files changed, 26 insertions, 14 deletions
diff --git a/cmd/cert.go b/cmd/cert.go
index 7b68f330ec..cd6972ea86 100644
--- a/cmd/cert.go
+++ b/cmd/cert.go
@@ -67,7 +67,7 @@ func pemBlockForKey(priv interface{}) *pem.Block {
}
}
-func runCert(ctx *cli.Context) {
+func runCert(ctx *cli.Context) error {
if len(ctx.String("host")) == 0 {
log.Fatal("Missing required --host parameter")
}
@@ -158,4 +158,6 @@ func runCert(ctx *cli.Context) {
pem.Encode(keyOut, pemBlockForKey(priv))
keyOut.Close()
log.Println("Written key.pem")
+
+ return nil
}
diff --git a/cmd/cert_stub.go b/cmd/cert_stub.go
index f848e246c6..78e84e8c04 100644
--- a/cmd/cert_stub.go
+++ b/cmd/cert_stub.go
@@ -20,7 +20,9 @@ var CmdCert = cli.Command{
Action: runCert,
}
-func runCert(ctx *cli.Context) {
+func runCert(ctx *cli.Context) error {
fmt.Println("Command cert not available, please use build tags 'cert' to rebuild.")
os.Exit(1)
+
+ return nil
}
diff --git a/cmd/dump.go b/cmd/dump.go
index 90082667bb..0a2f4e9cba 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -32,7 +32,7 @@ It can be used for backup and capture Gogs server image to send to maintainer`,
},
}
-func runDump(ctx *cli.Context) {
+func runDump(ctx *cli.Context) error {
if ctx.IsSet("config") {
setting.CustomConf = ctx.String("config")
}
@@ -68,21 +68,21 @@ func runDump(ctx *cli.Context) {
log.Fatalf("Fail to create %s: %v", fileName, err)
}
- if err := z.AddFile("gogs-repo.zip", reposDump); err !=nil {
+ if err := z.AddFile("gogs-repo.zip", reposDump); err != nil {
log.Fatalf("Fail to include gogs-repo.zip: %v", err)
}
- if err := z.AddFile("gogs-db.sql", dbDump); err !=nil {
+ if err := z.AddFile("gogs-db.sql", dbDump); err != nil {
log.Fatalf("Fail to include gogs-db.sql: %v", err)
}
customDir, err := os.Stat(setting.CustomPath)
if err == nil && customDir.IsDir() {
- if err := z.AddDir("custom", setting.CustomPath); err !=nil {
+ if err := z.AddDir("custom", setting.CustomPath); err != nil {
log.Fatalf("Fail to include custom: %v", err)
- }
+ }
} else {
log.Printf("Custom dir %s doesn't exist, skipped", setting.CustomPath)
}
- if err := z.AddDir("log", setting.LogRootPath); err !=nil {
+ if err := z.AddDir("log", setting.LogRootPath); err != nil {
log.Fatalf("Fail to include log: %v", err)
}
// FIXME: SSH key file.
@@ -94,4 +94,6 @@ func runDump(ctx *cli.Context) {
log.Printf("Removing tmp work dir: %s", TmpWorkDir)
os.RemoveAll(TmpWorkDir)
log.Printf("Finish dumping in file %s", fileName)
+
+ return nil
}
diff --git a/cmd/serve.go b/cmd/serve.go
index 83d8f8763a..2759e1b575 100644
--- a/cmd/serve.go
+++ b/cmd/serve.go
@@ -129,7 +129,7 @@ func handleUpdateTask(uuid string, user, repoUser *models.User, reponame string,
}
}
-func runServ(c *cli.Context) {
+func runServ(c *cli.Context) error {
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
@@ -138,7 +138,7 @@ func runServ(c *cli.Context) {
if setting.SSH.Disabled {
println("Gogs: SSH has been disabled")
- return
+ return nil
}
if len(c.Args()) < 1 {
@@ -149,7 +149,7 @@ func runServ(c *cli.Context) {
if len(cmd) == 0 {
println("Hi there, You've successfully authenticated, but Gogs does not provide shell access.")
println("If this is unexpected, please log in with password and setup Gogs under another user.")
- return
+ return nil
}
verb, args := parseCmd(cmd)
@@ -290,4 +290,6 @@ func runServ(c *cli.Context) {
fail("Internal error", "UpdatePublicKey: %v", err)
}
}
+
+ return nil
}
diff --git a/cmd/update.go b/cmd/update.go
index aca2a7cbe7..08d5d89e10 100644
--- a/cmd/update.go
+++ b/cmd/update.go
@@ -24,7 +24,7 @@ var CmdUpdate = cli.Command{
},
}
-func runUpdate(c *cli.Context) {
+func runUpdate(c *cli.Context) error {
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
@@ -33,7 +33,7 @@ func runUpdate(c *cli.Context) {
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
log.GitLogger.Trace("SSH_ORIGINAL_COMMAND is empty")
- return
+ return nil
}
args := c.Args()
@@ -53,4 +53,6 @@ func runUpdate(c *cli.Context) {
if err := models.AddUpdateTask(&task); err != nil {
log.GitLogger.Fatal(2, "AddUpdateTask: %v", err)
}
+
+ return nil
}
diff --git a/cmd/web.go b/cmd/web.go
index 1378cc3eca..07c64646c1 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -175,7 +175,7 @@ func newMacaron() *macaron.Macaron {
return m
}
-func runWeb(ctx *cli.Context) {
+func runWeb(ctx *cli.Context) error {
if ctx.IsSet("config") {
setting.CustomConf = ctx.String("config")
}
@@ -585,4 +585,6 @@ func runWeb(ctx *cli.Context) {
if err != nil {
log.Fatal(4, "Fail to start server: %v", err)
}
+
+ return nil
}