1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-20 02:07:40 +00:00
Files
janet/tools/removecr.janet
2019-10-19 19:11:13 -04:00

8 lines
278 B
Janet

# 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))
(def input (slurp fname))
(def new-source (string/replace-all "\r" "" source))
(spit fname new-source :wb)