mirror of
				https://github.com/janet-lang/janet
				synced 2025-11-04 01:23:04 +00:00 
			
		
		
		
	This caused bad stuff to be generated on windows, specifically the amalg file. We cause totally strip <CR> from files on windows using this script.
		
			
				
	
	
		
			10 lines
		
	
	
		
			333 B
		
	
	
	
		
			Clojure
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			333 B
		
	
	
	
		
			Clojure
		
	
	
	
	
	
# 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))
 | 
						|
(with [f (file/open fname :rb+)]
 | 
						|
  (def source (:read f :all))
 | 
						|
  (def new-source (string/replace-all "\r" "" source))
 | 
						|
  (:seek f :set 0)
 | 
						|
  (:write f new-source))
 |