Use proper filepaths

This commit is contained in:
2025-01-19 09:31:19 +01:00
parent 62e75eaea8
commit b8fd81a86d
8 changed files with 45 additions and 38 deletions

View File

@ -52,7 +52,7 @@ func newConfig() *Config {
PDFDir: "/var/www/cpolis/pdfs",
PicsDir: "/var/www/cpolis/pics",
Port: ":8080",
Version: "v0.15.0",
Version: "v0.15.2",
WebDir: "/var/www/cpolis/web",
}
}
@ -91,7 +91,7 @@ func mkFile(path string, filePerm, dirPerm fs.FileMode) (string, error) {
}
fileName := stringSlice[len(stringSlice)-1]
file, err := os.Create(dir + "/" + fileName)
file, err := os.Create(filepath.Join(dir, fileName))
if err != nil {
return "", fmt.Errorf("error creating %v: %v", fileName, err)
}