File Header Updater
The File Header Updater (FHU) tool is used to update the file headers of all OpenTwin source files.
Running the Tool
The File Header Updater can be executed conveniently using the provided batch file:
Location: Scripts/Other/UpdateFileHeaders.bat
This batch file serves as a launcher for the tool and handles the mandatory configuration automatically.
How It Works
The batch file forwards up to nine command line arguments directly to the File Header Updater tool. This means all standard arguments (e.g.
--dry,--preview) can be passed to the batch file when calling it.It automatically specifies the following paths:
Configuration file:
%OPENTWIN_DEV_ROOT%/Tools/FileHeaderUpdater/OT_FHU_Config.json- Used to define all file header update settings.Output log file:
%OPENTWIN_DEV_ROOT%/Tools/FileHeaderUpdater/FHU_Log.txt- Contains all tool output and summary information.
Special Option: --pause
If the first argument passed to the batch file is --pause, the script will pause after the tool finishes.
This allows to review the console output before the terminal window closes automatically.
Example Usage
:: Run the File Header Updater normally
Scripts\Other\UpdateFileHeaders.bat
:: Run with dry mode enabled (no files are changed)
Scripts\Other\UpdateFileHeaders.bat --dry
:: Run and preview the modified headers without applying changes
Scripts\Other\UpdateFileHeaders.bat --preview
:: Run and keep the console window open to review output of changed files
Scripts\Other\UpdateFileHeaders.bat --pause --notifychangeonly
Command Line Arguments
Note
Path variables may contain environment variables using the %EnvironmentVariableName% syntax.
Argument |
Description |
|---|---|
|
Specifies the path to the configuration file. |
|
[Optional] Specifies the output report file path. If not specified, the output is shown on standard output (e.g., the terminal) only. |
|
[Optional] Performs a dry run without modifying any files. |
|
[Optional] Shows the modified file data without writing changes to disk.
Automatically enables |
|
[Optional] Displays the help message. |
|
[Optional] Displays the currently imported configuration. |
|
[Optional] The output messages only notifies about changed files. Ignored or empty files are skipped in the output. |
Configuration File
Note
Path values may contain environment variables using the %EnvironmentVariableName% syntax.
The configuration file is a JSON file with the following members:
Key |
Type |
Description |
|---|---|---|
|
String (Path) |
Path to the license file. |
|
String |
Start keyword indicating the beginning of the license header. |
|
String |
Keyword indicating that the file should be ignored. |
|
String |
End keyword indicating the end of the license header. |
|
Array of Strings |
List of root directories to scan. |
|
Array of Strings |
List of file extensions to consider. |
Optional Members
The following members are optional:
Key |
Type |
Description |
|---|---|---|
|
Boolean |
If |
|
Boolean |
If |
|
String |
Prefix to add to each line of the license (e.g., comment characters). |
|
Boolean |
If |
|
Boolean |
If |
|
Array of Strings |
List of directories to exclude from scanning. |