#!/bin/bash
icons="../../components/icons.tsx"
sgvnames=$(ls *.svg)

for name in $sgvnames; do
svgInfo=$(grep $name $icons)
componentName=`echo "${name[@]^}" | sed 's/-\w/\U&/g' | tr -d '-' |sed 's/\.svg//g';`
if [ -z "$svgInfo" ] 
then
echo 'export { ReactComponent as SVG'$componentName' } from "assets/svg/'$name'";' >> $icons
echo "$name Added to icons.tsx"
else
echo "$name already exist"
fi
done


