Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 15, 2022
1 parent 066ddd3 commit c65a9b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions bootstrap/config.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package bootstrap

import (
"io/ioutil"
"os"
"path/filepath"

"github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/conf"
"github.com/alist-org/alist/v3/pkg/utils"
"github.com/caarlos0/env/v6"
log "github.com/sirupsen/logrus"
"io/ioutil"
"os"
"path/filepath"
)

func InitConfig() {
log.Infof("reading config file: %s", args.Config)
if !utils.Exists(args.Config) {
log.Infof("config file not exists, creating default config file")
_, err := utils.CreatNestedFile(args.Config)
_, err := utils.CreateNestedFile(args.Config)
if err != nil {
log.Fatalf("failed to create config file")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func Exists(name string) bool {
return true
}

// CreatNestedFile create nested file
func CreatNestedFile(path string) (*os.File, error) {
// CreateNestedFile create nested file
func CreateNestedFile(path string) (*os.File, error) {
basePath := filepath.Dir(path)
if !Exists(basePath) {
err := os.MkdirAll(basePath, 0700)
Expand Down

0 comments on commit c65a9b3

Please sign in to comment.