-
-
Notifications
You must be signed in to change notification settings - Fork 12
Handle Absolute JAR Path #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit fixes instances where the `jar` parameter is an absolute path to the JAR file. Previously, the path for ```js const java = new JavaCaller({ jar: "F:\\my-path\\file.jar", }); ``` would become `./F:\\my-path\\file.jar`. Now, it is kept as-is, allowing absolute paths to be provided.
This commit fixes instances where the `jar` parameter is an absolute path to the JAR file. Previously, the path for ```js const java = new JavaCaller({ jar: "F:\\my-path\\file.jar", }); ``` would become `./F:\\my-path\\file.jar`. Now, it is kept as-is, allowing absolute paths to be provided.
…e-java-caller into absolute-jar-path
@BrendanC23 the test class is failing, please can you have a look ? |
This commit fixes the handling of absolute paths, switching from `path.join()` to `path.isAbsolute()` to handle differing behavior for different platforms. `path.join()` works differently for Windows paths and Linux paths. `path.join(".", "C:\\") === "C:\\"` `path.join(".", "/home/test") === "home/test"` The latter is missing a leading `/` and thus is no longer an absolute path. As described in [this issue](GHSA-37v4-cwgp-x353), there was a NodeJS [security vulnerability](https://nodejs.org/en/blog/vulnerability/january-2025-security-releases) that caused the behavior of `path.join()` to be changed. Newer versions of Node will return a relative path in these instances, so `path.join(".", "C:\\") === ".\\C:\\"`.
@nvuillam I made some changes to the PR. There is one test that is failing due to a timeout. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
==========================================
+ Coverage 89.91% 89.95% +0.04%
==========================================
Files 3 3
Lines 228 229 +1
==========================================
+ Hits 205 206 +1
Misses 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrendanC23 thanks for the PR and sorry for the delay :)
This PR enables an absolute path to be passed as the
jar
parameter. It resolves #104. A new test (that previously would have failed) has been added.Now, this code works:
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance