diff --git a/README.md b/README.md index 3a78ed5..8b08619 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # Bubbles: A simple and expandable C++ project template with [Googletest](https://github.com/google/googletest) and [Boost](https://www.boost.org/) included. +## Initializing Project + +```bash +python3 initproject.py "project_name" +``` + ## Building && Testing ```bash diff --git a/initproject.py b/initproject.py new file mode 100644 index 0000000..dc65e1e --- /dev/null +++ b/initproject.py @@ -0,0 +1,21 @@ +import sys + +def main(args): + if not args: + print('Please enter a project name') + exit(1) + + if " " in args[0]: + print('Please remove spaces and special characters from the project name') + exit(1) + + with open('./CMakeLists.txt', 'r+') as f: + print(f'Changing project name to {args[0]}') + contents = f.read().replace('bubbles', args[0]) + f.seek(0) + f.write(contents) + f.truncate() + +if __name__ == '__main__': + main(sys.argv[1::]) +