Skip to content

Commit

Permalink
Merge branch 'bugfix/file_path' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
thedemoncat committed Mar 4, 2021
2 parents b9b88e6 + ccef34b commit 040ee01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"net/http/cookiejar"
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
Expand Down Expand Up @@ -316,7 +317,7 @@ func (dr *Downloader) fileNameFromUrl(rawUrl string) (string, string, error) {

func (dr *Downloader) downloadFile(fileToDownload *FileToDownload) (os.FileInfo, bool) {

fullpath := dr.BasePath + fileToDownload.path + fileToDownload.name
fullpath := filepath.Join(dr.BasePath, strings.ToLower(fileToDownload.path), fileToDownload.name)
fileInfo, err := os.Stat(fullpath)
if os.IsExist(err) {

Expand All @@ -331,7 +332,7 @@ func (dr *Downloader) downloadFile(fileToDownload *FileToDownload) (os.FileInfo,
return nil, false
}

err = os.MkdirAll(dr.BasePath+fileToDownload.path, os.ModeDir)
err = os.MkdirAll(filepath.Join(dr.BasePath, fileToDownload.path), os.ModeDir)
if err != nil {
return nil, false
}
Expand Down

0 comments on commit 040ee01

Please sign in to comment.