File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,4 @@ glob = "0.3"
2323toml = " 0.8"
2424tera = " 1.20"
2525json_comments = " 0.2"
26+ is-root = " 0.1"
Original file line number Diff line number Diff line change @@ -1301,14 +1301,13 @@ impl Xtasks {
13011301 fn init ( app_settings : GlobalArgs , dont_update_ide : bool ) -> Result < ( ) > {
13021302 // install alsa et al
13031303 if cfg ! ( target_os = "linux" ) {
1304+ let sudo = if !is_root:: is_root ( ) { "sudo" } else { "" } ;
1305+ let install_cmd = format ! ( "{sudo} apt-get update && sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev" ) ;
13041306 Self :: run_system_command (
13051307 & app_settings,
13061308 "sh" ,
13071309 "Failed to install Linux dependencies" ,
1308- vec ! [
1309- "-c" ,
1310- "sudo apt-get update && sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev"
1311- ] ,
1310+ vec ! [ "-c" , install_cmd. as_str( ) ] ,
13121311 None ,
13131312 ) ?;
13141313 }
You can’t perform that action at this time.
0 commit comments