#!/usr/bin/env bash
NAME=""

while [[ "$#" -gt 0 ]]; do
  case $1 in
    -n|--name)
      NAME=$2
      shift 2;;
    *)
      shift;;
  esac
done

if [ -z "$NAME" ]; then
  echo "No name provided, exiting..."
  exit 1
fi

find . -type f -exec sed -i "s|/raw/main/|/raw/$NAME/|g" {} +
