Skip to content

Instantly share code, notes, and snippets.

@likai24
Created November 24, 2016 08:23
Show Gist options
  • Save likai24/f4e80333563a84dfa568710bc77179f5 to your computer and use it in GitHub Desktop.
Save likai24/f4e80333563a84dfa568710bc77179f5 to your computer and use it in GitHub Desktop.
Script to generate the repository
#!/bin/bash
##Usage : path to the entities folder
path=$1
for fs in $(ls $path/*.php | grep Repository -v | grep Base -v) ;
do
ns=Tranz
#bundle=BMAPromotionBundle
bundle=$2
entity=$(basename "${fs}" | sed 's/\.[^.]*$//');
entity_lc="$(echo ${entity} | awk '{print tolower($0)}')"
echo $entity
eval "echo -e \"$(cat ${path}/template)\"" > $path/${entity}Repository.php ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment