Check if the snapd socket exists before trying to run it (fixes #56)
This commit is contained in:
@@ -201,6 +201,7 @@ pub fn run_flatpak(terminal: &mut Terminal) -> Option<(&'static str, bool)> {
|
|||||||
pub fn run_snap(sudo: &Option<PathBuf>, terminal: &mut Terminal) -> Option<(&'static str, bool)> {
|
pub fn run_snap(sudo: &Option<PathBuf>, terminal: &mut Terminal) -> Option<(&'static str, bool)> {
|
||||||
if let Some(sudo) = sudo {
|
if let Some(sudo) = sudo {
|
||||||
if let Some(snap) = which("snap") {
|
if let Some(snap) = which("snap") {
|
||||||
|
if PathBuf::from("/var/snapd.socket").exists() {
|
||||||
terminal.print_separator("snap");
|
terminal.print_separator("snap");
|
||||||
|
|
||||||
let success = || -> Result<(), failure::Error> {
|
let success = || -> Result<(), failure::Error> {
|
||||||
@@ -216,6 +217,7 @@ pub fn run_snap(sudo: &Option<PathBuf>, terminal: &mut Terminal) -> Option<(&'st
|
|||||||
return Some(("snap", success));
|
return Some(("snap", success));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user