@@ -16,9 +16,9 @@ INCLUDED_MODULES=()
1616function array-merge {
1717 # Declare an associative array
1818 declare -A tmp
19- # Store the values of arr3 in arr4 as keys.
19+ # Store the values of arr3 in arr4 as keys
2020 for k in $@ ; do tmp[" $k " ]=1; done
21- # Extract the keys.
21+ # Extract the keys
2222 echo " ${! tmp[@]} "
2323}
2424
@@ -31,7 +31,7 @@ function modules {
3131
3232# # Fire event $1 for all modules passed as args
3333# # Example of usage
34- # # fire event "test" "git" "make"
34+ # # fire_event "test" "git" "make"
3535# # Will call functions "git-test" and "make-test" if exists
3636function fire_event {
3737 local event=$1
@@ -46,7 +46,7 @@ function fire_event {
4646 done
4747}
4848
49- # # Provde datasource options for modules passed as args
49+ # # Provide datasource options for modules passed as args
5050# # Example of usage
5151# # datasources "git" "make"
5252function datasources {
@@ -67,7 +67,7 @@ MODULES=$(modules $IN)
6767
6868until [ -z " $MODULES " ]
6969do
70- # # Merge modules list with modules from previous iteration
70+ # # Merge module list with modules from previous iteration
7171 INCLUDED_MODULES=$( array-merge $INCLUDED_MODULES $MODULES )
7272 # # Prepare data for just found modules
7373 fire_event " template-prepare-data" $MODULES
7676
7777 # # For all iterations (except first) use $OUT file as $IN template to replace recursive placeholders
7878 IN=$OUT
79- # # Find modules in $IN file for next interation.
79+ # # Find modules in $IN file for the next iteration
8080 MODULES=$( modules $IN )
8181done
8282
@@ -86,6 +86,3 @@ fire_event "template-cleanup-data" $INCLUDED_MODULES
8686rm -rf $TMP
8787
8888echo " $OUT generated"
89-
90-
91-
0 commit comments