Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Structurizr scripts
#!/usr/bin/env python3
import fileinput
def cleanup(line: str) -> str:
return line.replace(" ", " ").replace('xml:space="preserve"', "")
def __main__():
# inplace=True causes standard output to be directed to the input file
for line in fileinput.input(inplace=True, backup=".bak"):
# since the line already ends with a newline char, we use end to avoid adding another
print(cleanup(line), end="")
if __name__ == "__main__":
#!/usr/bin/env bb
(require '[ :as xml]
'[ :as io])
(defn main [file-paths]
(doseq [fp file-paths]
(->> (io/reader fp)
(spit fp))))
(when (= *file* (System/getProperty "babashka.file"))
(main *command-line-args*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment