PyvesB / eclipse-solargraph

:gem: Ruby development tools for Eclipse.
https://marketplace.eclipse.org/content/ruby-solargraph
Eclipse Public License 2.0
30 stars 6 forks source link

eclipse-solargraph-plugin: Using a relative 'bash' command #22

Closed spchamp closed 2 years ago

spchamp commented 2 years ago

On some hosts, the bash shell may not have been installed under /bin.

On FreeBSD hosts for instance, bash may be installed from the shells/bash port at /usr/local/bin/bash, for a default prefix /usr/local. On NetBSD and generally under pkgsrc, bash may be available as /usr/pkg/bin/bash assuming a pkgsrc prefix /usr/pkg

This patch updates CommandHelper.getPlatformCommand(String) to use a relative pathname for the bash command.

For running the provided shell command via the shell interpreter on non-Windows platforms, the appropriate bash command can then be resolved from the environment PATH

Tested under Run As -> Eclipse Application with Eclipse 2022-09 on FreeBSD 13.1 (openjdk18)

spchamp commented 2 years ago

Unfortunately, the initial changeset included a bit of cruft from a source test while I was trying to figure out if Java provides anything like a shell 'which' command. I'll add an update to the patch branch, removing that comment line from the code.

spchamp commented 2 years ago

After updating to use Tycho 2.7.0 in the build, then running maven package with OpenJDK 11 under openSUSE, then installing the plugin *.jar file to my user plugins dir for the Eclipse installation on FreeBSD, I was able to test this patch consistently with Eclipse on FreeBSD.

It's also been tested on openSUSE Tumbleweed. There, I was able to test the patch directly in the Eclipse IDE, using the approach denoted in the eclipse-solargraph README