Consolidate compilation and copy code.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-11-10 17:45:00 +01:00
parent a799374399
commit 60c6cb3bcd

View File

@ -184,8 +184,10 @@ function build_project()
mkdir -p $OUTPUT_DIR/${i:${#SOURCE_DIR}}
done
for i in $(find $SOURCE_DIR -name '*.php' -not -name '*.cfg.php')
for i in $(find site -type f -regextype posix-extended -not -regex '.*\.(cfg|CFG)\.(php|PHP)')
do
if [[ $i =~ .*\.(php|PHP) ]]
then
: ${i:${#SOURCE_DIR}}
local OUT_FILE="$OUTPUT_DIR/${_: :-4}"
if [ $1 == 1 ]
@ -193,16 +195,14 @@ function build_project()
echo "Building $OUT_FILE ..."
fi
cat $PROJECT_CONFIG_FILE $i | php > $OUT_FILE
done
for i in $(find $SOURCE_DIR -type f -not -name '*.php')
do
else
local OUT_FILE="$OUTPUT_DIR/${i:${#SOURCE_DIR}}"
if [ $1 == 1 ]
then
echo "Copying $OUT_FILE ..."
fi
cp $i $OUT_FILE
fi
done
}