Closed blaisemccourtney closed 6 months ago
I made this helper script to delete the right pages and to double-check things.
import subprocess import os renamed_split_str = "_renamed_" if not os.path.exists("sdlwiki/SDL3/"): print("Repository expected at: sdlwiki/ . Works on folder: sdlwiki/SDL3/ .") exit(1) with open("SDL_oldnames.h") as f: removed_list = [] for line in f: if renamed_split_str in line: words = line.split(" ") for word in words: if renamed_split_str in word: [old_name, new_name] = word.split(renamed_split_str) old_name = old_name.strip() new_name = new_name.strip() path_to_delete = "SDL3/" + old_name + ".md" try: return_value = subprocess.check_call( "git rm " + path_to_delete, shell=True, cwd="sdlwiki", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL ) removed_list.append(old_name) print(old_name) except subprocess.CalledProcessError: pass if len(removed_list) < 1: print("!!! Did not find anything to remove! !!!") else: print("Removed: " + str(len(removed_list))) print("grep command: grep -rI \"\\(" + "\\|".join(removed_list) + "\\)\" .")
Thanks!
I made this helper script to delete the right pages and to double-check things.