1
0
mirror of https://github.com/janet-lang/janet synced 2026-03-08 00:39:49 +00:00
Files
janet/tools/removecr.janet

8 lines
278 B
Janet
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-19 19:11:13 -04:00
(def input (slurp fname))
2019-10-19 18:00:29 -05:00
(def new-source (string/replace-all "\r" "" source))
(spit fname new-source :wb)