forked from jason/cpolis
Use proper filepaths
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user