Last active
July 11, 2016 09:18
-
-
Save Senorsen/55c8326b7ecf94d4b7f105f118f2f9c0 to your computer and use it in GitHub Desktop.
This file contains 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
# for generate import | |
for f in *.ts; do MODEL_NAME=$(grep -ohw 'class \(\w\+Model\)' $f | grep -ohw '\w\+Model'); test $MODEL_NAME && echo "import ${MODEL_NAME} from './$(echo $f | sed 's/\.ts$//')';"; done | |
# for generate Interface | |
for f in *.ts; do MODEL_NAME=$(grep -ohw 'class \(\w\+Model\)' $f | grep -ohw '\w\+Model'); test $MODEL_NAME && echo "$(echo ${MODEL_NAME} | sed -e 's/\w/\L\0/' | sed -e 's/Model$//'): ${MODEL_NAME};"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment