parent
							
								
									be9bff0e5b
								
							
						
					
					
						commit
						22402a2e07
					
				| 
						 | 
					@ -1,25 +1,14 @@
 | 
				
			||||||
! Copyright (C) 2011 Doug Coleman.
 | 
					! Copyright (C) 2011 Doug Coleman.
 | 
				
			||||||
! See http://factorcode.org/license.txt for BSD license.
 | 
					! See http://factorcode.org/license.txt for BSD license.
 | 
				
			||||||
USING: arrays assocs environment fry
 | 
					USING: environment fry io.directories.search.windows io.files
 | 
				
			||||||
io.directories.search.windows io.files io.pathnames
 | 
					io.pathnames io.standard-paths kernel sequences splitting
 | 
				
			||||||
io.standard-paths kernel sequences splitting system
 | 
					system unicode.case ;
 | 
				
			||||||
unicode.case ;
 | 
					 | 
				
			||||||
IN: io.standard-paths.windows
 | 
					IN: io.standard-paths.windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: windows find-in-applications
 | 
					M: windows find-in-applications
 | 
				
			||||||
    '[ [ >lower _ tail? ] find-in-program-files ] map-find drop ;
 | 
					    '[ [ >lower _ tail? ] find-in-program-files ] map-find drop ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: path ( -- path )
 | 
					 | 
				
			||||||
    "PATH" os-env ";" split "." prefix ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
: path-extensions ( command -- commands )
 | 
					 | 
				
			||||||
    "PATHEXT" os-env [
 | 
					 | 
				
			||||||
        ";" split 2dup [ [ >lower ] bi@ tail? ] with any?
 | 
					 | 
				
			||||||
        [ drop 1array ] [ [ append ] with map ] if
 | 
					 | 
				
			||||||
    ] [ 1array ] if* ;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
M: windows find-in-path*
 | 
					M: windows find-in-path*
 | 
				
			||||||
    path-extensions path
 | 
					    [ "PATH" os-env ";" split ] dip
 | 
				
			||||||
    cartesian-product flip concat
 | 
					    '[ _ append-path exists? ] find nip ;
 | 
				
			||||||
    [ prepend-path ] { } assoc>map
 | 
					
 | 
				
			||||||
    [ exists? ] find nip ;
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue