chore: fix drivers not import

pull/1604/head
Noah Hsu 2022-08-07 13:23:15 +08:00
parent 0df3473337
commit 5b40254e3b
4 changed files with 8 additions and 7 deletions

View File

@ -2,12 +2,13 @@ package cmd
import (
"fmt"
"github.com/alist-org/alist/v3/cmd/flags"
_ "github.com/alist-org/alist/v3/drivers"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/server"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

View File

@ -6,9 +6,9 @@ package cmd
import (
"fmt"
"github.com/alist-org/alist/v3/internal/conf"
"os"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/spf13/cobra"
)

View File

@ -17,7 +17,7 @@ func init() {
TimestampFormat: "2006-01-02 15:04:05",
FullTimestamp: true,
})
logrus.SetLevel(logrus.DebugLevel)
// logrus.SetLevel(logrus.DebugLevel)
}
func Log() {

View File

@ -1,13 +1,13 @@
package operations
import (
"github.com/alist-org/alist/v3/internal/conf"
"reflect"
"strings"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/internal/driver"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
type New func() driver.Driver
@ -16,7 +16,7 @@ var driverNewMap = map[string]New{}
var driverItemsMap = map[string]driver.Items{}
func RegisterDriver(config driver.Config, driver New) {
log.Infof("register driver: [%s]", config.Name)
// log.Infof("register driver: [%s]", config.Name)
registerDriverItems(config, driver().GetAddition())
driverNewMap[config.Name] = driver
}
@ -42,7 +42,7 @@ func GetDriverItemsMap() map[string]driver.Items {
}
func registerDriverItems(config driver.Config, addition driver.Additional) {
log.Debugf("addition of %s: %+v", config.Name, addition)
// log.Debugf("addition of %s: %+v", config.Name, addition)
tAddition := reflect.TypeOf(addition)
mainItems := getMainItems(config)
additionalItems := getAdditionalItems(tAddition, config.DefaultRoot)