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,25 +184,25 @@ 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
: ${i:${#SOURCE_DIR}}
local OUT_FILE="$OUTPUT_DIR/${_: :-4}"
if [ $1 == 1 ]
if [[ $i =~ .*\.(php|PHP) ]]
then
echo "Building $OUT_FILE ..."
: ${i:${#SOURCE_DIR}}
local OUT_FILE="$OUTPUT_DIR/${_: :-4}"
if [ $1 == 1 ]
then
echo "Building $OUT_FILE ..."
fi
cat $PROJECT_CONFIG_FILE $i | php > $OUT_FILE
else
local OUT_FILE="$OUTPUT_DIR/${i:${#SOURCE_DIR}}"
if [ $1 == 1 ]
then
echo "Copying $OUT_FILE ..."
fi
cp $i $OUT_FILE
fi
cat $PROJECT_CONFIG_FILE $i | php > $OUT_FILE
done
for i in $(find $SOURCE_DIR -type f -not -name '*.php')
do
local OUT_FILE="$OUTPUT_DIR/${i:${#SOURCE_DIR}}"
if [ $1 == 1 ]
then
echo "Copying $OUT_FILE ..."
fi
cp $i $OUT_FILE
done
}