Skip to content

Commit

Permalink
3.0.9
Browse files Browse the repository at this point in the history
- fix #16, by adding arm64 and reference in aarch64
- fix special chars in path, like "(", causing issues
  • Loading branch information
Osiris-Team committed Jun 23, 2024
1 parent f86dbee commit 1363eff
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/headless-browser/
/headless-browser(1)/
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.osiris.headlessbrowser</groupId>
<artifactId>Headless-Browser</artifactId>
<version>3.0.7</version>
<version>3.0.9</version>
<repositories>
<repository>
<id>jitpack</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public NodeContext npmInstall(String packageName) throws IOException, Interrupte
result = executeNpmWithArgs("install");
if (result.exitValue() != 0)
throw new IOException("Failed to install/download " + packageName + "!" +
" Npm finished with exit code '" + result.exitValue() + "'.");
" Npm finished with exit code '" + result.exitValue() + "', npmExe="+npmExe);
printLnToDebug("[NPM-INSTALL] Installed '" + packageName + "' successfully!");
return this;
}
Expand All @@ -618,7 +618,7 @@ public NodeContext npmInstall(String packageName) throws IOException, Interrupte
public Process executeNpmWithArgs(String... args) throws IOException, InterruptedException {
synchronized (cachedResults){
List<String> commands = new ArrayList<>();
commands.add("" + npmExe);
commands.add("\"" + npmExe+"\""); // encapsulate in backticks to prevent special chars like ( causing issues
if (args != null && args.length != 0) commands.addAll(Arrays.asList(args));
printLnToDebug("Execute: " + commands);
CachedResult cachedResult = getCachedResultForCommand(commands);
Expand All @@ -641,7 +641,7 @@ public Process executeNpmWithArgs(String... args) throws IOException, Interrupte
public Process executeNpxWithArgs(String... args) throws IOException, InterruptedException {
synchronized (cachedResults){
List<String> commands = new ArrayList<>();
commands.add("" + npxExe);
commands.add("\"" + npxExe+"\""); // encapsulate in backticks to prevent special chars like ( causing issues
if (args != null && args.length != 0) commands.addAll(Arrays.asList(args));
printLnToDebug("Execute: " + commands);
CachedResult cachedResult = getCachedResultForCommand(commands);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/osiris/headlessbrowser/utils/OS.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ public enum Arch {
PPC64("ppc64"),
PPC64LE("ppc64le"),
S390X("s390x"),
AARCH64("aarch64"),
AARCH64("aarch64", "arm64"),
ARM("arm"),
ARM64( "arm64", "aarch64"),
SPARCV9("sparcv9"),
RISCV64("riscv64"),
// x64 with alternative names:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package com.osiris.headlessbrowser.issues;
package com.osiris.headlessbrowser;

import com.osiris.headlessbrowser.HBrowser;
import com.osiris.headlessbrowser.exceptions.NodeJsCodeException;
import com.osiris.headlessbrowser.windows.PlaywrightWindow;
import org.junit.jupiter.api.Test;

public class Issue9 {
public static void main(String[] args) {
import java.io.File;

public class Bugs {
@Test
void weirdPathSupported() throws NodeJsCodeException {
File dir = new File(System.getProperty("user.dir") + "/headless-browser(1)");
try(PlaywrightWindow win = new HBrowser().setMainDirectory(dir)
.openCustomWindow().debugOutputStream(System.out)
.buildPlaywrightWindow()){
win.load(TestConst.htmlTestFile);
win.leftClick("body");
}
}

@Test
void issue9(){
HBrowser hBrowser = new HBrowser();
try (PlaywrightWindow window = hBrowser.openCustomWindow().headless(false).buildPlaywrightWindow()) {
for (int i = 0; i < 20; i++) {
Expand Down
5 changes: 0 additions & 5 deletions src/test/java/com/osiris/headlessbrowser/HBrowserTest.java

This file was deleted.

7 changes: 7 additions & 0 deletions src/test/java/com/osiris/headlessbrowser/TestConst.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.osiris.headlessbrowser;

import java.io.File;

class TestConst {
public static File htmlTestFile = new File(System.getProperty("user.dir")+"/test.html");
}

0 comments on commit 1363eff

Please sign in to comment.