░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/packages/canvas-planner/scripts
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: generate-themeable
#!/bin/bash -e COMPONENTS_DIR=src/components COMPONENT_TEMPLATE_DIR=scripts/templates/themeable read -p 'Component name: ' component export COMPONENT=$component if [ ! -d "$COMPONENTS_DIR" ]; then echo Cannot find component directory! exit 1 fi if [ ! -d "$COMPONENT_TEMPLATE_DIR" ]; then echo Cannot find component template! exit 1 fi if [ -d "$COMPONENTS_DIR/$COMPONENT" ]; then echo Oops! Component $COMPONENT exists! exit 1 fi echo Generating $COMPONENT files in $COMPONENTS_DIR/$COMPONENT cp -r $COMPONENT_TEMPLATE_DIR $COMPONENTS_DIR/$COMPONENT # Update file names find $COMPONENTS_DIR/$COMPONENT -name 'Component*' -type f -exec bash -c 'mv "$1" "${1/Component/$COMPONENT}"' -- {} \; # Update file contents if [[ "$OSTYPE" == darwin* ]]; then find $COMPONENTS_DIR/$COMPONENT -type f -exec sed -i '' "s/\${COMPONENT}/$COMPONENT/g" '{}' \; else find $COMPONENTS_DIR/$COMPONENT -type f -exec sed -i -e "s/\${COMPONENT}/$COMPONENT/g" '{}' \; fi
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📁 templates/
DIR
—
2023-09-24 03:39
📄 generate-themeable
?
974 B
2023-09-24 03:39
EDIT
📄 release
?
2.5 KB
2023-09-24 03:39
EDIT