tinty 0.1.0

Change the theme of your terminal, text editor and anything else with one command!
#!/usr/bin/env bash

# Generate schemes.txt based on latest schemes/base16 schemes

script_path=$(realpath "$0")
script_dir=$(dirname "$script_path")
project_dir=$(dirname "$script_dir")
base16_schemes_repo_dir="$project_dir/schemes"
schemes_dir="$base16_schemes_repo_dir/base16"
schemes_file_path="$project_dir/public/schemes.txt"

if [ -d "$base16_schemes_repo_dir" ]; then
  rm -rf "$base16_schemes_repo_dir"
fi

if [ -f "$schemes_file_path" ]; then
  rm "$schemes_file_path"
fi

git clone git@github.com:tinted-theming/schemes.git "$base16_schemes_repo_dir"

for path in "$schemes_dir"/*; do
  filename=$(basename -- "$path")

  # Only extract yaml files
  if [[ $filename == *.yaml ]]; then
    # Remove '.yaml' suffix
    theme_name="$filename"
    theme_name="${theme_name%.yaml}"

    echo "$theme_name" >> "$schemes_file_path"
  fi
done