Move custom emoji dir if it exists. Closes #2379
This commit is contained in:
parent
61c07757b2
commit
223b6dd388
@ -36,6 +36,7 @@ func Start() error {
|
||||
resetDirectories()
|
||||
|
||||
data.PopulateDefaults()
|
||||
utils.MigrateCustomEmojiLocations()
|
||||
|
||||
if err := data.VerifySettings(); err != nil {
|
||||
log.Error(err)
|
||||
|
23
utils/emojiMigration.go
Normal file
23
utils/emojiMigration.go
Normal file
@ -0,0 +1,23 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"path"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// MigrateCustomEmojiLocations migrates custom emoji from the old location to the new location.
|
||||
func MigrateCustomEmojiLocations() {
|
||||
oldLocation := path.Join("webroot", "img", "emoji")
|
||||
newLocation := path.Join("data", "emoji")
|
||||
|
||||
if !DoesFileExists(oldLocation) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Println("Moving custom emoji directory from", oldLocation, "to", newLocation)
|
||||
|
||||
if err := Move(oldLocation, newLocation); err != nil {
|
||||
log.Errorln("error moving custom emoji directory", err)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user