
// editEmojiFiles.go provides a utility to edit the emoji files in bulk
// I've already changed some colors, and we might want to change more

package main

import "seekia/internal/localFilesystem"

import goFilepath "path/filepath"

import "os"
import "log"
import "strings"


func main(){

	emojisFolderPath := "../../internal/imageFiles/emojis/"

	fileList, err := os.ReadDir(emojisFolderPath)
	if (err != nil) {
		log.Println(err)
		return
	}

	for _, fileObject := range fileList{

		fileName := fileObject.Name()
		filePath := goFilepath.Join(emojisFolderPath, fileName)

		fileBytes, err := os.ReadFile(filePath)
		if (err != nil){
			log.Println(err)
			return
		}

		fileString := string(fileBytes)

		containsAny := strings.Contains(fileString, "#7C0000")
		if (containsAny == false){
			continue
		}

		// Change color here:
		newFileString := strings.ReplaceAll(fileString, "#7C0000", "#7C0000")

		err = localFilesystem.CreateOrOverwriteFile([]byte(newFileString), emojisFolderPath, fileName)
		if (err != nil){
			log.Println(err)
			return
		}
	}
}


