mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
Process --no-process-group
This commit is contained in:
parent
ec49185488
commit
bb212b413f
@ -163,7 +163,7 @@ pub fn get_args() -> Result<ArgMatches<'static>> {
|
|||||||
.help_heading(Some(OPTSET_OUTPUT))
|
.help_heading(Some(OPTSET_OUTPUT))
|
||||||
.help("Do not set WATCHEXEC_*_PATH environment variables for the command")
|
.help("Do not set WATCHEXEC_*_PATH environment variables for the command")
|
||||||
.long("no-environment"))
|
.long("no-environment"))
|
||||||
.arg(Arg::with_name("no-process-group") // TODO
|
.arg(Arg::with_name("no-process-group")
|
||||||
.help_heading(Some(OPTSET_COMMAND))
|
.help_heading(Some(OPTSET_COMMAND))
|
||||||
.help("Do not use a process group when running the command")
|
.help("Do not use a process group when running the command")
|
||||||
.long("no-process-group"))
|
.long("no-process-group"))
|
||||||
|
@ -38,6 +38,10 @@ pub fn runtime(args: &ArgMatches<'static>) -> Result<RuntimeConfig> {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if args.is_present("no-process-group") {
|
||||||
|
config.command_grouped(false);
|
||||||
|
}
|
||||||
|
|
||||||
config.command_shell(if args.is_present("no-shell") {
|
config.command_shell(if args.is_present("no-shell") {
|
||||||
Shell::None
|
Shell::None
|
||||||
} else if let Some(s) = args.value_of("shell") {
|
} else if let Some(s) = args.value_of("shell") {
|
||||||
@ -174,6 +178,8 @@ pub fn runtime(args: &ArgMatches<'static>) -> Result<RuntimeConfig> {
|
|||||||
fut
|
fut
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: pre-command (environment vars)
|
||||||
|
|
||||||
Ok(config)
|
Ok(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ use std::{
|
|||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
env,
|
env,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
sync::Arc,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
@ -10,7 +9,6 @@ use dunce::canonicalize;
|
|||||||
use miette::{IntoDiagnostic, Result};
|
use miette::{IntoDiagnostic, Result};
|
||||||
use tracing::{debug, warn};
|
use tracing::{debug, warn};
|
||||||
use watchexec::{
|
use watchexec::{
|
||||||
filter::tagged::{Filter, Matcher, Op, Pattern, Regex, TaggedFilterer},
|
|
||||||
ignore_files::{self, IgnoreFile},
|
ignore_files::{self, IgnoreFile},
|
||||||
paths::common_prefix,
|
paths::common_prefix,
|
||||||
project::{self, ProjectType},
|
project::{self, ProjectType},
|
||||||
@ -36,7 +34,7 @@ pub async fn dirs(args: &ArgMatches<'static>) -> Result<(PathBuf, PathBuf)> {
|
|||||||
Ok((project_origin, workdir))
|
Ok((project_origin, workdir))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn ignores(args: &ArgMatches<'static>, origin: &Path) -> Result<Vec<IgnoreFile>> {
|
pub async fn ignores(_args: &ArgMatches<'static>, origin: &Path) -> Result<Vec<IgnoreFile>> {
|
||||||
let vcs_types = project::types(origin)
|
let vcs_types = project::types(origin)
|
||||||
.await
|
.await
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -105,5 +103,8 @@ pub async fn ignores(args: &ArgMatches<'static>, origin: &Path) -> Result<Vec<Ig
|
|||||||
debug!(?ignores, "combined and applied final filter over ignores");
|
debug!(?ignores, "combined and applied final filter over ignores");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: --no-ignore
|
||||||
|
// TODO: --no-vcs-ignore
|
||||||
|
|
||||||
Ok(ignores)
|
Ok(ignores)
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,8 @@ use miette::{IntoDiagnostic, Result};
|
|||||||
use watchexec::filter::globset::GlobsetFilterer;
|
use watchexec::filter::globset::GlobsetFilterer;
|
||||||
|
|
||||||
pub async fn globset(args: &ArgMatches<'static>) -> Result<Arc<GlobsetFilterer>> {
|
pub async fn globset(args: &ArgMatches<'static>) -> Result<Arc<GlobsetFilterer>> {
|
||||||
let (project_origin, workdir) = super::common::dirs(args).await?;
|
let (project_origin, _workdir) = super::common::dirs(args).await?;
|
||||||
let ignores = super::common::ignores(args, &project_origin).await?;
|
let _ignores = super::common::ignores(args, &project_origin).await?;
|
||||||
// TODO: load ignorefiles
|
// TODO: load ignorefiles
|
||||||
|
|
||||||
let filters = args
|
let filters = args
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use miette::{IntoDiagnostic, Result};
|
use miette::Result;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
use watchexec::filter::tagged::{Filter, Matcher, Op, Pattern, Regex, TaggedFilterer};
|
use watchexec::filter::tagged::{Filter, TaggedFilterer};
|
||||||
|
|
||||||
pub async fn tagged(args: &ArgMatches<'static>) -> Result<Arc<TaggedFilterer>> {
|
pub async fn tagged(args: &ArgMatches<'static>) -> Result<Arc<TaggedFilterer>> {
|
||||||
let (project_origin, workdir) = super::common::dirs(args).await?;
|
let (project_origin, workdir) = super::common::dirs(args).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user