|
@@ -11,13 +11,11 @@
|
|
set -e
|
|
set -e
|
|
|
|
|
|
# parameters
|
|
# parameters
|
|
-CORE_TARGET_FILE="$1" # target file path for core statistics
|
|
|
|
-RELEASE_TARGET_FILE="$2" # target file path for release package statistics
|
|
|
|
|
|
+TARGET_FILE="$1" # statistics target file path
|
|
|
|
|
|
# print parameters
|
|
# print parameters
|
|
echo "Updating cloc statistics..."
|
|
echo "Updating cloc statistics..."
|
|
-printf 'CORE_TARGET_FILE="%s"\n' "$CORE_TARGET_FILE"
|
|
|
|
-printf 'RELEASE_TARGET_FILE="%s"\n' "$RELEASE_TARGET_FILE"
|
|
|
|
|
|
+printf 'TARGET_FILE="%s"\n' "$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
|
|
|
|
-printf 'Creating temporary files...\n'
|
|
|
|
-CORE_TMP_FILE="$(mktemp)"
|
|
|
|
-RELEASE_TMP_FILE="$(mktemp)"
|
|
|
|
-[ -n "$CORE_TMP_FILE" ] && [ -n "$RELEASE_TMP_FILE" ] || exit 1
|
|
|
|
|
|
+# create temporary file
|
|
|
|
+printf 'Creating temporary file...\n'
|
|
|
|
+TMP_FILE="$(mktemp)"
|
|
|
|
+[ -n "$TMP_FILE" ] || exit 1
|
|
echo
|
|
echo
|
|
|
|
|
|
-# create core statistics
|
|
|
|
-printf 'Creating core statistics...\n'
|
|
|
|
-create_cloc_stats "$CORE_TMP_FILE" \
|
|
|
|
|
|
+# create statistics
|
|
|
|
+printf 'Creating statistics...\n'
|
|
|
|
+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'
|
|
|
|
-clean_cloc_stats "$CORE_TMP_FILE" > "$CORE_TARGET_FILE"
|
|
|
|
-
|
|
|
|
-printf 'Writing release package statistics file without header...\n'
|
|
|
|
-clean_cloc_stats "$RELEASE_TMP_FILE" > "$RELEASE_TARGET_FILE"
|
|
|
|
|
|
+printf 'Writing statistics file without header...\n'
|
|
|
|
+clean_cloc_stats "$TMP_FILE" > "$TARGET_FILE"
|
|
echo
|
|
echo
|
|
|
|
|
|
-# remove temporary files
|
|
|
|
-printf 'Removing temporary files...\n'
|
|
|
|
-rm "$CORE_TMP_FILE" "$RELEASE_TMP_FILE"
|
|
|
|
|
|
+# remove temporary file
|
|
|
|
+printf 'Removing temporary file...\n'
|
|
|
|
+rm "$TMP_FILE"
|
|
echo
|
|
echo
|