Call the examples regeneration script from the add example script

This commit is contained in:
Tessa Kelly 2024-02-02 11:34:15 -07:00
parent 18da65c4af
commit d6d1ae09fa
2 changed files with 15 additions and 0 deletions

View File

@ -47,6 +47,15 @@ echo "Creating \`Examples.${example_name}\` for you in the component-catalog fol
path=component-catalog/src/Examples/"${example_name}.elm"
printf "${template}" >| "${path}"
echo ""
echo "Created ${path}."
echo ""
echo "Regenerating \`Examples.elm\` so it inclues \`Examples.${example_name}\`."
. ./script/regenerate-examples.sh
echo ""
echo "🚨 There are TODOs for you to complete in ${path}. 🚨"
echo ""

View File

@ -63,6 +63,8 @@ type Msg
MSG
)
echo "Cataloging the \`component-catalog/src/Examples/\` folder..."
cd component-catalog/src/Examples/
i=0
for example in *
@ -92,8 +94,12 @@ done
cd ..
echo "Replacing \`component-catalog/src/Examples.elm\`..."
printf "${file_open}" >| Examples.elm
printf "\n\n${imports}\n\n\n" >> Examples.elm
printf "${all}\n\n\n" >> Examples.elm
printf "${state}\n\n\n" >> Examples.elm
printf "${msg}\n" >> Examples.elm
echo "Done! \`Examples\` should now be up to date."