1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
mod builder;
mod workspace;

pub(crate) use builder::build;

use log::error;
use workspace::AngularWorkspace;

use crate::{Config, Result};

/// Stop any running background process for the given configuration
///
/// # Errors
///
/// This function will return an error if any errors occur trying to detect or
/// stop the process. This is only likely to happen when trying to stop a
/// background process not belonging to the current user.
pub fn stop_background_process(config: &Config) -> Result<()> {
	if cfg!(all(unix, feature = "background")) {
		builder::stop_background_process(config)
	} else {
		error!("Background process is not supported by this build");
		Ok(())
	}
}