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"
23
23
toml = " 0.8"
24
24
tera = " 1.20"
25
25
json_comments = " 0.2"
26
+ is-root = " 0.1"
Original file line number Diff line number Diff line change @@ -1301,14 +1301,13 @@ impl Xtasks {
1301
1301
fn init ( app_settings : GlobalArgs , dont_update_ide : bool ) -> Result < ( ) > {
1302
1302
// install alsa et al
1303
1303
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" ) ;
1304
1306
Self :: run_system_command (
1305
1307
& app_settings,
1306
1308
"sh" ,
1307
1309
"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( ) ] ,
1312
1311
None ,
1313
1312
) ?;
1314
1313
}
You can’t perform that action at this time.
0 commit comments