#!/bin/bash

# Navigate to the directory where files are downloaded
DOWNLOAD_DIR="./temp"  # Update this path if necessary
cd "$DOWNLOAD_DIR" || exit

# Rename files: lowercase and change extension from .json to .tgs
for FILE in *.tgs; do
  # Convert filename to lowercase and replace the extension
  LOWERCASE_NAME=$(echo "$FILE" | tr '[:upper:]' '[:lower:]' | sed 's/.json$/.tgs/')
  
  # Rename the file
  mv "$FILE" "$LOWERCASE_NAME"
done

echo "Renaming complete!"

