feat: use cobra and add some command

This commit is contained in:
Noah Hsu
2022-08-07 13:09:59 +08:00
parent 2b5da3ef34
commit 0df3473337
20 changed files with 279 additions and 96 deletions

View File

@ -1,7 +1,7 @@
package common
import (
"github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/cmd/flags"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
@ -10,7 +10,7 @@ import (
// @param l: if true, log error
func ErrorResp(c *gin.Context, err error, code int, l ...bool) {
if len(l) > 0 && l[0] {
if args.Debug || args.Dev {
if flags.Debug || flags.Dev {
log.Errorf("%+v", err)
} else {
log.Errorf("%v", err)