Created
November 24, 2016 08:23
-
-
Save likai24/f4e80333563a84dfa568710bc77179f5 to your computer and use it in GitHub Desktop.
Script to generate the repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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