Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Task #7 - Find Button is not working
  • Loading branch information
albilu committed Nov 24, 2024
1 parent fd5b511 commit 5066a5c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<properties>
<keystore>target/keystore</keystore>
<netbeans.release.version>RELEASE210</netbeans.release.version>
<next.version>1.0.1</next.version>
<next.version>1.0.2</next.version>
<git.url>https://github.com/albilu/${project.name}</git.url>
<git.link>https://github.com/albilu/${project.name}.git</git.link>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public class RipGrepMatcher extends AbstractMatcher {
"org.netbeans.modules.ripgrep",
false);

Collection listFiles = FileUtils.listFiles(bins, new NameFileFilter(new String[]{"rg", "rg.exe"}), new DirectoryFileFilter() {
Collection<File> listFiles = FileUtils.listFiles(bins, new NameFileFilter(new String[]{"rg", "rg.exe"}),
new DirectoryFileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory() && StringUtils.equalsAny(file.getName(), "windows", "linux", "mac");
Expand All @@ -68,32 +69,29 @@ public boolean accept(File file) {
});
switch (Utilities.getOperatingSystem()) {
case Utilities.OS_LINUX:
RG_COMMAND = (String) listFiles.stream()
.map((f) -> {
File file = (File) f;
file.setExecutable(true, true);
return file.getAbsolutePath();
})
.filter((path) -> ((String) path).endsWith("linux/rg")).findFirst().get();
RG_COMMAND = listFiles.stream()
.filter(file -> file.getParentFile().getName().equals("linux"))
.map(f -> {
f.setExecutable(true, true);
return f;
}).findFirst().get().getAbsolutePath();
break;

case Utilities.OS_WIN_OTHER:
RG_COMMAND = (String) listFiles.stream()
.map((f) -> {
File file = (File) f;
file.setExecutable(true, true);
return file.getAbsolutePath();
})
.filter((path) -> ((String) path).endsWith("windows/rg.exe")).findFirst().get();
RG_COMMAND = listFiles.stream()
.filter(file -> file.getParentFile().getName().equals("windows"))
.map(f -> {
f.setExecutable(true, true);
return f;
}).findFirst().get().getAbsolutePath();
break;
case Utilities.OS_MAC:
RG_COMMAND = (String) listFiles.stream()
.map((f) -> {
File file = (File) f;
file.setExecutable(true, true);
return file.getAbsolutePath();
})
.filter((path) -> ((String) path).endsWith("ios/rg")).findFirst().get();
RG_COMMAND = listFiles.stream()
.filter(file -> file.getParentFile().getName().equals("ios"))
.map(f -> {
f.setExecutable(true, true);
return f;
}).findFirst().get().getAbsolutePath();
break;
default:
LOG.warning("Couldn't find provided Ripgrep binaries. Swithing to default installed 'rg' command");
Expand Down Expand Up @@ -251,10 +249,10 @@ private List<String> buildCommand() {
command.add("pcre2");
}

//multiline search
// multiline search
if (searchTerm.matches(".*\\n.*")) {
command.add("--multiline");
//command.removeIf((c) -> c.equals("--fixed-strings"));
// command.removeIf((c) -> c.equals("--fixed-strings"));
}

// Set the directory to getProcess in
Expand Down
6 changes: 3 additions & 3 deletions updates.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Catalog 2.8//EN" "http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd">
<module_updates timestamp="00/00/00/03/06/2024">
<module codenamebase="io.github.albilu.fastsearch" distribution="https://github.com/albilu/fast-search/releases/download/1.0.0/fastsearch-1.0.0.nbm" downloadsize="133405377" homepage="https://github.com/albilu/fastsearch" moduleauthor="albilu" needsrestart="true" releasedate="2024/06/03">
<manifest OpenIDE-Module="io.github.albilu.fastsearch" AutoUpdate-Show-In-Client="true" OpenIDE-Module-Display-Category="Tools" OpenIDE-Module-Implementation-Version="1.0.0" OpenIDE-Module-Name="Fast Search" OpenIDE-Module-Short-Description="Netbeans Faster Search Module based on Ripgrep" OpenIDE-Module-Specification-Version="1.0.0"/>
<module_updates timestamp="00/00/00/24/11/2024">
<module codenamebase="io.github.albilu.fastsearch" distribution="https://github.com/albilu/fast-search/releases/download/1.0.2/fastsearch-1.0.2.nbm" downloadsize="133405377" homepage="https://github.com/albilu/fastsearch" moduleauthor="albilu" needsrestart="true" releasedate="2024/11/24">
<manifest OpenIDE-Module="io.github.albilu.fastsearch" AutoUpdate-Show-In-Client="true" OpenIDE-Module-Display-Category="Tools" OpenIDE-Module-Implementation-Version="1.0.2" OpenIDE-Module-Name="Fast Search" OpenIDE-Module-Short-Description="Netbeans Faster Search Module based on Ripgrep" OpenIDE-Module-Specification-Version="1.0.2"/>
</module>
</module_updates>

0 comments on commit 5066a5c

Please sign in to comment.