combine script will now include modules that are not require()'d by any other module
parent
2efdbe8969
commit
70142f5059
|
@ -30,7 +30,7 @@ RMTRAIL="$PATH_TOOLS/rmtrail"
|
||||||
|
|
||||||
# determine the order in which modules must be concatenated; order matters to
|
# determine the order in which modules must be concatenated; order matters to
|
||||||
# ensure dependencies are loaded before the module that depends on them
|
# ensure dependencies are loaded before the module that depends on them
|
||||||
CAT_MODULES=$(
|
cat_modules=$(
|
||||||
cd "$PATH_TOOLS/../" &&
|
cd "$PATH_TOOLS/../" &&
|
||||||
grep -rIo ' require(.*)' lib/ \
|
grep -rIo ' require(.*)' lib/ \
|
||||||
| sed "s/^lib\///;s/\.js://;s/require(.*'\/\(.*\)'.*/\1/" \
|
| sed "s/^lib\///;s/\.js://;s/require(.*'\/\(.*\)'.*/\1/" \
|
||||||
|
@ -40,6 +40,24 @@ CAT_MODULES=$(
|
||||||
exit 3
|
exit 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get a list of all available modules
|
||||||
|
all_modules=$(
|
||||||
|
cd "$PATH_LIB" &&
|
||||||
|
ls -1 *.js \
|
||||||
|
| sed 's/\.js$//'
|
||||||
|
)
|
||||||
|
|
||||||
|
# get lsit of modules that haven't been
|
||||||
|
remain_modules=$(
|
||||||
|
echo "$cat_modules
|
||||||
|
$all_modules" \
|
||||||
|
| sort \
|
||||||
|
| uniq -u
|
||||||
|
)
|
||||||
|
|
||||||
|
cat_modules="$cat_modules
|
||||||
|
$remain_modules"
|
||||||
|
|
||||||
##
|
##
|
||||||
# Output template header
|
# Output template header
|
||||||
##
|
##
|
||||||
|
@ -91,7 +109,7 @@ fi
|
||||||
tpl_header
|
tpl_header
|
||||||
|
|
||||||
# output each of the modules
|
# output each of the modules
|
||||||
for module in $CAT_MODULES; do
|
for module in $cat_modules; do
|
||||||
filename="$PATH_LIB/$module.$MODULE_EXT"
|
filename="$PATH_LIB/$module.$MODULE_EXT"
|
||||||
|
|
||||||
if [ ! -f "$filename" ]; then
|
if [ ! -f "$filename" ]; then
|
||||||
|
|
Loading…
Reference in New Issue