File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change
1
+ #[ cfg( not( windows) ) ]
1
2
use std:: env;
2
3
use std:: fs;
3
4
use std:: io;
4
5
use std:: io:: Write ;
5
6
use std:: path:: Path ;
6
7
use std:: str;
7
8
9
+ #[ cfg( not( windows) ) ]
8
10
use crate :: process;
9
11
10
12
pub ( crate ) fn ensure_dir_exists < P : AsRef < Path > , F : FnOnce ( & Path ) > (
@@ -247,6 +249,7 @@ pub(crate) fn copy_dir(src: &Path, dest: &Path) -> io::Result<()> {
247
249
Ok ( ( ) )
248
250
}
249
251
252
+ #[ cfg( not( windows) ) ]
250
253
fn has_cmd ( cmd : & str ) -> bool {
251
254
let cmd = format ! ( "{}{}" , cmd, env:: consts:: EXE_SUFFIX ) ;
252
255
let path = process ( ) . var_os ( "PATH" ) . unwrap_or_default ( ) ;
@@ -255,6 +258,7 @@ fn has_cmd(cmd: &str) -> bool {
255
258
. any ( |p| p. exists ( ) )
256
259
}
257
260
261
+ #[ cfg( not( windows) ) ]
258
262
pub ( crate ) fn find_cmd < ' a > ( cmds : & [ & ' a str ] ) -> Option < & ' a str > {
259
263
cmds. iter ( ) . cloned ( ) . find ( |& s| has_cmd ( s) )
260
264
}
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ use crate::utils::notifications::Notification;
16
16
use crate :: utils:: raw;
17
17
use crate :: { home_process, process} ;
18
18
19
- pub ( crate ) use crate :: utils:: utils:: raw:: { find_cmd, if_not_empty, is_directory} ;
19
+ #[ cfg( not( windows) ) ]
20
+ pub ( crate ) use crate :: utils:: utils:: raw:: find_cmd;
21
+ pub ( crate ) use crate :: utils:: utils:: raw:: { if_not_empty, is_directory} ;
20
22
21
23
pub use crate :: utils:: utils:: raw:: { is_file, path_exists} ;
22
24
@@ -423,6 +425,7 @@ pub(crate) fn open_browser(path: &Path) -> Result<()> {
423
425
opener:: open_browser ( path) . context ( "couldn't open browser" )
424
426
}
425
427
428
+ #[ cfg( not( windows) ) ]
426
429
fn set_permissions ( path : & Path , perms : fs:: Permissions ) -> Result < ( ) > {
427
430
fs:: set_permissions ( path, perms) . map_err ( |e| {
428
431
RustupError :: SettingPermissions {
You can’t perform that action at this time.
0 commit comments