mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-24 06:14:04 +08:00
fix: error if use abs temp path (close #1624)
This commit is contained in:
parent
92fba9a2bf
commit
4af9124162
@ -48,16 +48,14 @@ func InitConfig() {
|
||||
confFromEnv()
|
||||
}
|
||||
// convert abs path
|
||||
var absPath string
|
||||
var err error
|
||||
if !filepath.IsAbs(conf.Conf.TempDir) {
|
||||
absPath, err = filepath.Abs(conf.Conf.TempDir)
|
||||
absPath, err := filepath.Abs(conf.Conf.TempDir)
|
||||
if err != nil {
|
||||
log.Fatalf("get abs path error: %+v", err)
|
||||
}
|
||||
conf.Conf.TempDir = absPath
|
||||
}
|
||||
conf.Conf.TempDir = absPath
|
||||
err = os.RemoveAll(filepath.Join(conf.Conf.TempDir))
|
||||
err := os.RemoveAll(filepath.Join(conf.Conf.TempDir))
|
||||
if err != nil {
|
||||
log.Errorln("failed delete temp file:", err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user