Release 1.9.7.0 - Summer Update 2025
This commit is contained in:
56
changelogs/combine_changelogs.bat
Normal file
56
changelogs/combine_changelogs.bat
Normal file
@@ -0,0 +1,56 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
rem This file combines all the other .txt files in this directory into changelog.txt,
|
||||
rem or another file name given as optional argument.
|
||||
|
||||
rem Determine script's absolute directory and use that for paths
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
||||
set "DEFAULT_TARGET_FILE=changelog.txt"
|
||||
|
||||
rem A different target file can be provided as argument
|
||||
if "%~1"=="" (
|
||||
set "TARGET_FILE=%SCRIPT_DIR%\%DEFAULT_TARGET_FILE%"
|
||||
) else (
|
||||
set "TARGET_FILE=%SCRIPT_DIR%\%~1"
|
||||
)
|
||||
|
||||
if not exist "%TARGET_FILE%" (
|
||||
echo %TARGET_FILE% doesn't exist yet, creating it
|
||||
type nul > "%TARGET_FILE%"
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Appending *.txt into %TARGET_FILE%:
|
||||
for %%F in ("%SCRIPT_DIR%\*.txt") do (
|
||||
if exist "%%F" (
|
||||
rem Skip target file(s) that we're appending into
|
||||
set "BASENAME=%%~nxF"
|
||||
if /i "!BASENAME!"=="%DEFAULT_TARGET_FILE%" (
|
||||
echo - Skipping target file: %%~nxF
|
||||
) else (
|
||||
for %%T in ("%TARGET_FILE%") do (
|
||||
if /i "!BASENAME!"=="%%~nxT" (
|
||||
echo - Skipping target file: %%~nxF
|
||||
) else (
|
||||
echo + %%~nxF
|
||||
rem Strip path and extension from the file name and append as heading
|
||||
echo %%~nF>> "%TARGET_FILE%"
|
||||
rem Append file content
|
||||
type "%%F" >> "%TARGET_FILE%"
|
||||
rem Add a newline after each file's content
|
||||
echo.>> "%TARGET_FILE%"
|
||||
)
|
||||
)
|
||||
)
|
||||
) else (
|
||||
echo ERROR: %%F is missing or not a proper file, skipping!
|
||||
)
|
||||
)
|
||||
|
||||
echo.
|
||||
rem Finished file name in upper case and without path as heading
|
||||
for %%T in ("%TARGET_FILE%") do echo === %%~nxT:
|
||||
echo.
|
||||
rem Print the finished file itself
|
||||
type "%TARGET_FILE%"
|
||||
57
changelogs/combine_changelogs.sh
Normal file
57
changelogs/combine_changelogs.sh
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
##
|
||||
# This file combines all the other .txt files in this directory into changelog.txt,
|
||||
# or another file name given as optional argument.
|
||||
#
|
||||
|
||||
|
||||
# Determine script's absolute directory and use that for the paths, so the
|
||||
# script can be executed from anywhere
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
DEFAULT_TARGET_FILE="changelog.txt"
|
||||
|
||||
# A different target file can be provided as argument
|
||||
if [ $# -eq 1 ]; then
|
||||
TARGET_FILE="$SCRIPT_DIR/$1"
|
||||
else
|
||||
TARGET_FILE="$SCRIPT_DIR/$DEFAULT_TARGET_FILE"
|
||||
fi
|
||||
|
||||
if [ ! -f "$TARGET_FILE" ]; then
|
||||
echo "$TARGET_FILE doesn't exist yet, creating it"
|
||||
touch "$TARGET_FILE"
|
||||
fi
|
||||
|
||||
|
||||
echo ""
|
||||
echo "Appending *.txt into $(basename "$TARGET_FILE"):"
|
||||
for file in "$SCRIPT_DIR"/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
# Skip target file(s) that we're appending into
|
||||
if [[ "$(basename "$file")" = "$DEFAULT_TARGET_FILE" ||
|
||||
"$(basename "$file")" = "$(basename "$TARGET_FILE")" ]]; then
|
||||
echo " - Skipping target file: $(basename "$file")"
|
||||
continue
|
||||
fi
|
||||
echo " + $(basename "$file")"
|
||||
|
||||
# Strip path and extension from the file name and append it as heading for the entry
|
||||
echo "$(basename "${file%.*}")" >> "$TARGET_FILE"
|
||||
# Append file content
|
||||
cat "$file" >> "$TARGET_FILE"
|
||||
# Add a newline after each file's content
|
||||
echo "" >> "$TARGET_FILE"
|
||||
else
|
||||
echo "ERROR: $file is missing or not a proper file, skipping!"
|
||||
fi
|
||||
done
|
||||
echo ""
|
||||
|
||||
# Finished file name in upper case and without path as heading
|
||||
echo "=== $(basename "$TARGET_FILE"):"
|
||||
echo ""
|
||||
|
||||
# Print the finished file itself
|
||||
cat "$TARGET_FILE"
|
||||
Reference in New Issue
Block a user