1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-18 14:44:48 +00:00
janet/tools/removecr.janet

8 lines
279 B
Clojure
Raw Normal View History

# Remove carriage returns from file. Since piping things on
# windows may add bad line endings, we can just force removal
# with this script.
(def fname ((dyn :args) 1))
2019-10-29 23:56:32 +00:00
(def source (slurp fname))
2019-10-19 23:00:29 +00:00
(def new-source (string/replace-all "\r" "" source))
(spit fname new-source :wb)