This is an automated email from the ASF dual-hosted git repository.
thiagoelg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 7b7f036b302 NO-ISSUE: Fix setPomProperty on macOS (GNU sed vs BSD sed)
(#3419)
7b7f036b302 is described below
commit 7b7f036b302b3d8fd684f9bb54af2b4490da1dd9
Author: Thiago Lugli <[email protected]>
AuthorDate: Fri Jan 30 14:49:07 2026 -0300
NO-ISSUE: Fix setPomProperty on macOS (GNU sed vs BSD sed) (#3419)
---
packages/maven-base/index.js | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/packages/maven-base/index.js b/packages/maven-base/index.js
index 6809e99ce6e..7b87413ff85 100755
--- a/packages/maven-base/index.js
+++ b/packages/maven-base/index.js
@@ -45,6 +45,20 @@ const DEFAULT_LOCAL_REPO = String(
const BOOTSTRAP_CLI_ARGS = `-P-include-1st-party-dependencies
--settings=${SETTINGS_XML_PATH}`;
+function getSedFlavor() {
+ try {
+ // GNU sed supports --version and exits with 0
+ const output = cp.execSync("sed --version", { stdio: "pipe" }).toString();
+ if (output.includes("GNU")) {
+ return "gnu";
+ }
+ } catch (e) {
+ // BSD sed fails on --version and exits with non-zero
+ return "bsd";
+ }
+ return "unknown";
+}
+
module.exports = {
/**
* Evaluation of ${settings.localRepository}.
@@ -148,7 +162,7 @@ module.exports = {
if (process.platform === "win32") {
cp.execSync(cmd.replaceAll(" -", " `-"), { stdio: "inherit", shell:
"powershell.exe" });
- } else if (process.platform === "darwin") {
+ } else if (getSedFlavor() === "bsd") {
// Account for macOS BSD sed implementation
cp.execSync(cmd.replace("-i", "-i ''"), { stdio: "inherit" });
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]