#!/bin/bash

if [ -z "$1" ]
then
  echo "Usage: ./create_zoox_project.sh service_name"
  exit 1
fi

DRIVING_ROOT=$(git rev-parse --show-toplevel)
ZOOX_SERVICE=$DRIVING_ROOT/infra/helm/zoox-service
cp -r $ZOOX_SERVICE $DRIVING_ROOT/infra/helm/$1
cd $DRIVING_ROOT/infra/helm/$1
egrep -lRZ "CHARTNAME" . | xargs sed -i.bak "s/\<CHARTNAME\>/$1/g"
rm **.bak
