1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-16 19:52:49 +00:00

added docker support

This commit is contained in:
2018-05-30 21:23:03 -05:00
parent af8448e028
commit 3d05a49a3e
20 changed files with 125 additions and 196 deletions

View File

@@ -35,13 +35,13 @@ func FileUpload(c *gin.Context) {
file.Filename = strings.Replace(file.Filename, " ", "", -1)
// check if file already exists
if _, err := os.Stat(config.Config.SoundsPath + file.Filename); err == nil {
if _, err := os.Stat(config.Config.SoundsPath + "/" + file.Filename); err == nil {
c.JSON(http.StatusInternalServerError, "File already exists.")
return
}
err = c.SaveUploadedFile(file, config.Config.SoundsPath+file.Filename)
log.Debug("Saving file", config.Config.SoundsPath+file.Filename)
err = c.SaveUploadedFile(file, config.Config.SoundsPath+"/"+file.Filename)
log.Debug("Saving file", config.Config.SoundsPath+"/"+file.Filename)
if err != nil {
log.Error(err)
@@ -49,14 +49,5 @@ func FileUpload(c *gin.Context) {
return
}
// repopulate sound list
err = PopulateSoundList()
if err != nil {
log.Error(err)
c.JSON(http.StatusInternalServerError, "Error populating sound list.")
return
}
c.JSON(200, "Success")
}