You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
382 B

from __future__ import annotations
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Provide a path")
filePath = sys.argv[1]
with open(filePath, "r+") as fp:
content = fp.read()
content = content.replace('href="../', 'href="/').replace('src="../', 'src="/')
fp.seek(0)
fp.truncate()
fp.write(content)