removed old code
This commit is contained in:
@ -174,7 +174,6 @@ def modifyFiles(config, destinationDirectory):
|
|||||||
raise ValueError(f"Text '{after_text}' not found in file: {filePath}")
|
raise ValueError(f"Text '{after_text}' not found in file: {filePath}")
|
||||||
elif insert_text not in content:
|
elif insert_text not in content:
|
||||||
print(f" {Colors.GREEN}Inserting text after: {after_text} {Colors.YELLOW}+ ->{Colors.GREEN} {insert_text}{Colors.RESET}")
|
print(f" {Colors.GREEN}Inserting text after: {after_text} {Colors.YELLOW}+ ->{Colors.GREEN} {insert_text}{Colors.RESET}")
|
||||||
# content = content.replace(after_text, after_text + insert_text)
|
|
||||||
content = content.replace(after_text, after_text + insert_text.replace('\n', ''))
|
content = content.replace(after_text, after_text + insert_text.replace('\n', ''))
|
||||||
else:
|
else:
|
||||||
print(f" {Colors.YELLOW}Text already present after: {after_text}{Colors.RESET}")
|
print(f" {Colors.YELLOW}Text already present after: {after_text}{Colors.RESET}")
|
||||||
@ -188,7 +187,6 @@ def modifyFiles(config, destinationDirectory):
|
|||||||
raise ValueError(f"Text '{before_text}' not found in file: {filePath}")
|
raise ValueError(f"Text '{before_text}' not found in file: {filePath}")
|
||||||
elif insert_text not in content:
|
elif insert_text not in content:
|
||||||
print(f" {Colors.GREEN}Inserting text before: {insert_text} {Colors.YELLOW}+ <-{Colors.GREEN} {before_text}{Colors.RESET}")
|
print(f" {Colors.GREEN}Inserting text before: {insert_text} {Colors.YELLOW}+ <-{Colors.GREEN} {before_text}{Colors.RESET}")
|
||||||
# content = content.replace(before_text, insert_text + before_text)
|
|
||||||
content = content.replace(before_text, insert_text.replace('\n', '') + before_text)
|
content = content.replace(before_text, insert_text.replace('\n', '') + before_text)
|
||||||
else:
|
else:
|
||||||
print(f" {Colors.YELLOW}Text already present before: {before_text}{Colors.RESET}")
|
print(f" {Colors.YELLOW}Text already present before: {before_text}{Colors.RESET}")
|
||||||
|
Reference in New Issue
Block a user