mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-09 14:30:37 +00:00
case insensitive extension matching (fixes #43)
This commit is contained in:
parent
2924c8e007
commit
63a9618357
@ -1,7 +1,8 @@
|
|||||||
# 0.9.6 (2020-05-18)
|
# 0.9.6 (2020-05-18)
|
||||||
|
|
||||||
- Fix windows builds
|
- Fix windows builds
|
||||||
- Move to Github Actions instead of Travis
|
- Case insensitive file extension matching
|
||||||
|
- Move to Github Actions instead of Travis
|
||||||
|
|
||||||
# 0.9.5 (2020-04-08)
|
# 0.9.5 (2020-04-08)
|
||||||
|
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1008,7 +1008,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ripgrep_all"
|
name = "ripgrep_all"
|
||||||
version = "0.9.13-alpha.0"
|
version = "0.9.6-alpha.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"bzip2",
|
"bzip2",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use failure::Fallible;
|
use failure::Fallible;
|
||||||
|
use log::*;
|
||||||
use rga::adapters::spawning::map_exe_error;
|
use rga::adapters::spawning::map_exe_error;
|
||||||
use rga::adapters::*;
|
use rga::adapters::*;
|
||||||
use rga::args::*;
|
use rga::args::*;
|
||||||
@ -75,8 +76,8 @@ fn main() -> Result<(), exitfailure::ExitFailure> {
|
|||||||
let extensions = adapters
|
let extensions = adapters
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|a| &a.metadata().fast_matchers)
|
.flat_map(|a| &a.metadata().fast_matchers)
|
||||||
.filter_map(|m| match m {
|
.flat_map(|m| match m {
|
||||||
FastMatcher::FileExtension(ext) => Some(ext as &str),
|
FastMatcher::FileExtension(ext) => vec![ext.clone(), ext.to_ascii_uppercase()],
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(",");
|
.join(",");
|
||||||
@ -94,10 +95,13 @@ fn main() -> Result<(), exitfailure::ExitFailure> {
|
|||||||
"--smart-case",
|
"--smart-case",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let exe = std::env::current_exe().expect("Could not get executable location");
|
||||||
|
let preproc_exe = exe.with_file_name("rga-preproc");
|
||||||
|
|
||||||
let mut child = Command::new("rg")
|
let mut child = Command::new("rg")
|
||||||
.args(rg_args)
|
.args(rg_args)
|
||||||
.arg("--pre")
|
.arg("--pre")
|
||||||
.arg("rga-preproc")
|
.arg(preproc_exe)
|
||||||
.arg("--pre-glob")
|
.arg("--pre-glob")
|
||||||
.arg(pre_glob)
|
.arg(pre_glob)
|
||||||
.args(passthrough_args)
|
.args(passthrough_args)
|
||||||
@ -108,7 +112,7 @@ fn main() -> Result<(), exitfailure::ExitFailure> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// add the directory that contains `rga` to PATH, so ripgrep can find rga-preproc and rga-preproc can find pandoc etc (if we are on Windows where we include dependent binaries)
|
/// add the directory that contains `rga` to PATH, so rga-preproc can find pandoc etc (if we are on Windows where we include dependent binaries)
|
||||||
fn add_exe_to_path() -> Fallible<()> {
|
fn add_exe_to_path() -> Fallible<()> {
|
||||||
use std::env;
|
use std::env;
|
||||||
let mut exe = env::current_exe().expect("Could not get executable location");
|
let mut exe = env::current_exe().expect("Could not get executable location");
|
||||||
|
@ -42,7 +42,7 @@ pub struct FileMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn extension_to_regex(extension: &str) -> Regex {
|
pub fn extension_to_regex(extension: &str) -> Regex {
|
||||||
Regex::new(&format!("\\.{}$", ®ex::escape(extension))).expect("we know this regex compiles")
|
Regex::new(&format!("(?i)\\.{}$", ®ex::escape(extension))).expect("we know this regex compiles")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn adapter_matcher<T: AsRef<str>>(
|
pub fn adapter_matcher<T: AsRef<str>>(
|
||||||
|
Loading…
Reference in New Issue
Block a user