Created
October 6, 2014 19:31
-
-
Save valer-cara/6960693bdbc9d9a37287 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
#!/bin/bash | |
tmpfile="/tmp/__our_temp" | |
scripts_root="$(git root)/app/scripts" | |
esc_root=${scripts_root//\//\\/} | |
files=`find $scripts_root -type f -print` | |
for file in $files; do | |
line1=$(sed -ne '1p' $file) | |
if (echo $line1 | grep -q ^App); then | |
echo File $file matches. Adding default jsdoc comments. | |
submodule=`dirname $file | sed -e "s/$esc_root//" | cut -f 2 -d '/'` | |
class=$(echo $line1 | cut -f 1 -d "=" | tr -d ' ') | |
if [ -z $submodule ]; then continue; fi | |
cat << END > $tmpfile | |
###* | |
# @module App | |
# @submodule $submodule | |
### | |
###* | |
# @class $class | |
### | |
END | |
cat $file >> $tmpfile | |
rm $file | |
mv $tmpfile $file | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment