Compare commits

..

No commits in common. "2cf3906c4b44ebef25987b7814c89c820405cd64" and "1bb05ad1fc9b5dc0d56e400e339b0890c9b7645b" have entirely different histories.

View File

@ -36,10 +36,10 @@ while getopts "o:s:j:h" opt
do
case "$opt" in
o)
OUTPUT_DIR="$(echo "${OPTARG}" | sed 's:/*$::')"
OUTPUT_DIR="${OPTARG}"
;;
s)
SOURCE_DIR="$(echo "${OPTARG}" | sed 's:/*$::')"
SOURCE_DIR="${OPTARG}"
;;
j)
JOBS="${OPTARG}"
@ -67,18 +67,18 @@ export SOURCE_DIR
while IFS= read -r -d '' dir
do
OUT_DIR="${OUTPUT_DIR}/${dir:((${#SOURCE_DIR} + 1))}"
OUT_DIR="${OUTPUT_DIR}/${dir:${#SOURCE_DIR}}"
if ! [ -d "$OUT_DIR" ]
then
mkdir -p "$OUT_DIR"
mkdir -p "${OUTPUT_DIR}/${dir:${#SOURCE_DIR}}"
fi
done < <(find "$SOURCE_DIR" -type d -print0)
done < <(find "$SOURCE_DIR" -mindepth 1 -type d -print0)
function process_file() {
file="$1"
if [[ $file = *.php ]]
then
DEST_FILE="${OUTPUT_DIR}/${file:((${#SOURCE_DIR} + 1)):-4}"
DEST_FILE="${OUTPUT_DIR}/${file:${#SOURCE_DIR}:-4}"
if ! [ "$file" -nt "$DEST_FILE" ]
then
return
@ -87,7 +87,7 @@ function process_file() {
php "$file" > "$DEST_FILE"
echo "done"
else
DEST_FILE="${OUTPUT_DIR}/${file:((${#SOURCE_DIR} + 1))}"
DEST_FILE="${OUTPUT_DIR}/${file:${#SOURCE_DIR}}"
if ! [ "$file" -nt "$DEST_FILE" ]
then
return