2323#![ allow( clippy:: upper_case_acronyms) ]
2424#![ allow( clippy:: wildcard_imports) ]
2525
26+ #[ macro_use]
27+ extern crate lazy_static;
28+
29+ use std:: collections:: HashMap ;
2630use std:: env;
2731use std:: ffi:: { OsStr , OsString } ;
2832use std:: io:: { self , Write , ErrorKind } ;
2933use std:: path:: { Component , PathBuf } ;
3034
3135use ansi_term:: { ANSIStrings , Style } ;
36+ use proc_mounts:: MOUNTS ;
3237
3338use log:: * ;
3439
35- use crate :: fs:: { Dir , File } ;
40+ use crate :: fs:: { Dir , File , MountedFs } ;
3641use crate :: fs:: feature:: git:: GitCache ;
3742use crate :: fs:: filter:: GitIgnore ;
3843use crate :: options:: { Options , Vars , vars, OptionsResult } ;
@@ -46,6 +51,23 @@ mod options;
4651mod output;
4752mod theme;
4853
54+ lazy_static ! {
55+ static ref ALL_MOUNTS : HashMap <PathBuf , MountedFs > = {
56+ let mut m = HashMap :: new( ) ;
57+ if cfg!( unix) {
58+ for mount_point in & MOUNTS . read( ) . unwrap( ) . 0 {
59+ let mount = MountedFs {
60+ dest: mount_point. dest. to_string_lossy( ) . into_owned( ) ,
61+ fstype: mount_point. fstype. clone( ) ,
62+ source: mount_point. source. to_string_lossy( ) . into_owned( ) ,
63+ } ;
64+ m. insert( mount_point. dest. clone( ) , mount) ;
65+ }
66+ }
67+ m
68+ } ;
69+ }
70+
4971
5072fn main ( ) {
5173 use std:: process:: exit;
0 commit comments