| | |
| | | import os.path |
| | | import sys |
| | | |
| | | ## To Do |
| | | # - Breaking Changes |
| | | # - Merge Commits |
| | | # - Error Handling |
| | | # - Deal with wrong user input (spelling, no repo) |
| | | |
| | | def getSeparatedGitLog(repo): |
| | | try: |
| | |
| | | |
| | | #### Main #### |
| | | |
| | | pathToRepo = "/Users/daniel/Developer/Repos/HfM/schumacher/Prisma-Binauralize" |
| | | #pathToRepo = "/Users/daniel/Desktop/testrepo" |
| | | inputPath = input("Please enter the base path of the repository: ") |
| | | userDecision = input("Should the generated changelog be stored in another location (y/n)? ").lower() |
| | | if userDecision == "y": |
| | | outputPath = (input("Please enter the output path: ")) |
| | | elif userDecision == "n": |
| | | print("The changelog will be stored in the same location as the repository.") |
| | | outputPath = inputPath |
| | | else: |
| | | print("invalid input") |
| | | sys.exit(1) |
| | | |
| | | commitList = getSeparatedGitLog(pathToRepo) |
| | | commitList = getSeparatedGitLog(inputPath) |
| | | |
| | | # Create a list of commits |
| | | commitHistory = [] |
| | |
| | | |
| | | |
| | | # write into changelog |
| | | with open(pathToRepo + "/changelog.md", "w") as file: |
| | | with open(outputPath + "/changelog.md", "w") as file: |
| | | for line in fileTemplate: |
| | | file.write(line + "\n") |