mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-11-02 11:26:26 +00:00
53f29d9365
There's no new functionality here. It's purely tooling + CI stuff: - moved `python` => `tools` - moved documentation images to subfolder - moved `vs/tests` to tests/vs projects - moved `vs` solution etc to root - added semicolons to macros - added cpp.hint to help VS intellisense - migrated documentation generation to external lib
32 lines
960 B
Python
32 lines
960 B
Python
#!/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(utils.entry_script_dir(), '..', '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)
|