File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -136,21 +136,14 @@ pub fn is_writable<P: AsRef<Path>>(path: P) -> bool {
136
136
/// Set the mode of a path to 755 if we're on a Unix machine, otherwise
137
137
/// don't do anything with the given path.
138
138
#[ cfg( not( feature = "managed" ) ) ]
139
+ #[ cfg( not( windows) ) ]
139
140
pub fn set_executable_mode < P : AsRef < Path > > ( path : P ) -> Result < ( ) > {
140
- #[ cfg( not( windows) ) ]
141
- fn exec < P : AsRef < Path > > ( path : P ) -> io:: Result < ( ) > {
142
- use std:: os:: unix:: fs:: PermissionsExt ;
143
- let mut perm = fs:: metadata ( & path) ?. permissions ( ) ;
144
- perm. set_mode ( 0o755 ) ;
145
- fs:: set_permissions ( & path, perm)
146
- }
141
+ use std:: os:: unix:: fs:: PermissionsExt ;
147
142
148
- #[ cfg( windows) ]
149
- fn exec < P : AsRef < Path > > ( _path : P ) -> io:: Result < ( ) > {
150
- Ok ( ( ) )
151
- }
143
+ let mut perm = fs:: metadata ( & path) ?. permissions ( ) ;
144
+ perm. set_mode ( 0o755 ) ;
145
+ fs:: set_permissions ( & path, perm) ?;
152
146
153
- exec ( path) ?;
154
147
Ok ( ( ) )
155
148
}
156
149
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ use crate::api::{Api, SentryCliRelease};
20
20
use crate :: config:: Config ;
21
21
use crate :: constants:: { APP_NAME , VERSION } ;
22
22
#[ cfg( not( feature = "managed" ) ) ]
23
- use crate :: utils:: fs:: { is_writable, set_executable_mode} ;
23
+ use crate :: utils:: fs:: is_writable;
24
+ #[ cfg( not( windows) ) ]
25
+ #[ cfg( not( feature = "managed" ) ) ]
26
+ use crate :: utils:: fs:: set_executable_mode;
24
27
#[ cfg( not( feature = "managed" ) ) ]
25
28
use crate :: utils:: system:: QuietExit ;
26
29
use crate :: utils:: system:: { is_homebrew_install, is_npm_install} ;
@@ -171,6 +174,7 @@ impl SentryCliUpdateInfo {
171
174
}
172
175
} ;
173
176
177
+ #[ cfg( not( windows) ) ]
174
178
set_executable_mode ( & tmp_path) ?;
175
179
rename_exe ( & exe, & tmp_path, elevate) ?;
176
180
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments