|
|
@ -11,13 +11,11 @@ |
|
|
|
set -e |
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
|
|
# parameters |
|
|
|
# parameters |
|
|
|
CORE_TARGET_FILE="$1" # target file path for core statistics |
|
|
|
TARGET_FILE="$1" # statistics target file path |
|
|
|
RELEASE_TARGET_FILE="$2" # target file path for release package statistics |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# print parameters |
|
|
|
# print parameters |
|
|
|
echo "Updating cloc statistics..." |
|
|
|
echo "Updating cloc statistics..." |
|
|
|
printf 'CORE_TARGET_FILE="%s"\n' "$CORE_TARGET_FILE" |
|
|
|
printf 'TARGET_FILE="%s"\n' "$TARGET_FILE" |
|
|
|
printf 'RELEASE_TARGET_FILE="%s"\n' "$RELEASE_TARGET_FILE" |
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
# create cloc statistics |
|
|
|
# create cloc statistics |
|
|
@ -70,35 +68,24 @@ clean_cloc_stats() { |
|
|
|
done < <(tail -n +3 "$1") |
|
|
|
done < <(tail -n +3 "$1") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# create temporary files |
|
|
|
# create temporary file |
|
|
|
printf 'Creating temporary files...\n' |
|
|
|
printf 'Creating temporary file...\n' |
|
|
|
CORE_TMP_FILE="$(mktemp)" |
|
|
|
TMP_FILE="$(mktemp)" |
|
|
|
RELEASE_TMP_FILE="$(mktemp)" |
|
|
|
[ -n "$TMP_FILE" ] || exit 1 |
|
|
|
[ -n "$CORE_TMP_FILE" ] && [ -n "$RELEASE_TMP_FILE" ] || exit 1 |
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
# create core statistics |
|
|
|
# create statistics |
|
|
|
printf 'Creating core statistics...\n' |
|
|
|
printf 'Creating statistics...\n' |
|
|
|
create_cloc_stats "$CORE_TMP_FILE" \ |
|
|
|
create_cloc_stats "$TMP_FILE" \ |
|
|
|
lib index.php |
|
|
|
lib index.php |
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
printf 'Creating release package statistics...\n' |
|
|
|
|
|
|
|
create_cloc_stats "$RELEASE_TMP_FILE" \ |
|
|
|
|
|
|
|
README.md LICENSE.md CONTRIBUTING.md CHANGELOG.md \ |
|
|
|
|
|
|
|
assets config content content-sample lib plugins themes \ |
|
|
|
|
|
|
|
.htaccess index.php.dist composer.json |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# remove headers from cloc statistics |
|
|
|
# remove headers from cloc statistics |
|
|
|
printf 'Writing core statistics file without header...\n' |
|
|
|
printf 'Writing statistics file without header...\n' |
|
|
|
clean_cloc_stats "$CORE_TMP_FILE" > "$CORE_TARGET_FILE" |
|
|
|
clean_cloc_stats "$TMP_FILE" > "$TARGET_FILE" |
|
|
|
|
|
|
|
|
|
|
|
printf 'Writing release package statistics file without header...\n' |
|
|
|
|
|
|
|
clean_cloc_stats "$RELEASE_TMP_FILE" > "$RELEASE_TARGET_FILE" |
|
|
|
|
|
|
|
echo |
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
# remove temporary files |
|
|
|
# remove temporary file |
|
|
|
printf 'Removing temporary files...\n' |
|
|
|
printf 'Removing temporary file...\n' |
|
|
|
rm "$CORE_TMP_FILE" "$RELEASE_TMP_FILE" |
|
|
|
rm "$TMP_FILE" |
|
|
|
echo |
|
|
|
echo |
|
|
|