emojiMigration.go 551 B

1234567891011121314151617181920212223
  1. package utils
  2. import (
  3. "path"
  4. log "github.com/sirupsen/logrus"
  5. )
  6. // MigrateCustomEmojiLocations migrates custom emoji from the old location to the new location.
  7. func MigrateCustomEmojiLocations() {
  8. oldLocation := path.Join("webroot", "img", "emoji")
  9. newLocation := path.Join("data", "emoji")
  10. if !DoesFileExists(oldLocation) {
  11. return
  12. }
  13. log.Println("Moving custom emoji directory from", oldLocation, "to", newLocation)
  14. if err := Move(oldLocation, newLocation); err != nil {
  15. log.Errorln("error moving custom emoji directory", err)
  16. }
  17. }