diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:44:05 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:44:05 +0300 |
| commit | 0b24459ac12b6cf9fd5a401d647796ca254a8fa8 (patch) | |
| tree | f2fd66e2476976a51e2a51330fd95dc6e87b24c1 /tomlplusplus/tools/ci_single_header_check.py | |
| parent | b85e90fc3480da0e6a48da73201a0b22488cc650 (diff) | |
| parent | 1c8b7466e4946fcc3bf20484c0e1d001202cca5a (diff) | |
| download | Project-Tick-0b24459ac12b6cf9fd5a401d647796ca254a8fa8.tar.gz Project-Tick-0b24459ac12b6cf9fd5a401d647796ca254a8fa8.zip | |
Add 'tomlplusplus/' from commit '1c8b7466e4946fcc3bf20484c0e1d001202cca5a'
git-subtree-dir: tomlplusplus
git-subtree-mainline: b85e90fc3480da0e6a48da73201a0b22488cc650
git-subtree-split: 1c8b7466e4946fcc3bf20484c0e1d001202cca5a
Diffstat (limited to 'tomlplusplus/tools/ci_single_header_check.py')
| -rwxr-xr-x | tomlplusplus/tools/ci_single_header_check.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tomlplusplus/tools/ci_single_header_check.py b/tomlplusplus/tools/ci_single_header_check.py new file mode 100755 index 0000000000..aeed9498ca --- /dev/null +++ b/tomlplusplus/tools/ci_single_header_check.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# This file is a part of toml++ and is subject to the the terms of the MIT license. +# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au> +# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text. +# SPDX-License-Identifier: MIT + +import sys +import utils +from pathlib import Path + + +def main(): + hpp_path = Path(Path(__file__).resolve().parents[1], 'toml.hpp').resolve() + hash1 = utils.sha1(utils.read_all_text_from_file(hpp_path, logger=True)) + print(rf'Hash 1: {hash1}') + utils.run_python_script(r'generate_single_header.py') + hash2 = utils.sha1(utils.read_all_text_from_file(hpp_path, logger=True)) + print(rf'Hash 2: {hash2}') + if (hash1 != hash2): + print( + "toml.hpp wasn't up-to-date!\nRun generate_single_header.py before your commit to prevent this error.", + file=sys.stderr + ) + return 1 + print("toml.hpp was up-to-date") + return 0 + + + +if __name__ == '__main__': + utils.run(main, verbose=True) |
