graphviz-s icon indicating copy to clipboard operation
graphviz-s copied to clipboard

assume dot is on path

Open joprice opened this issue 9 years ago • 5 comments

On my local machine, dot is at /usr/local/bin/dot. If it is safe to assume that dot is on the path and executable, I don't see a problem with referencing it directly.

joprice avatar May 31 '15 19:05 joprice

Hi @joprice -- I think we need to make the location of dot configurable. It varies from place to place, and isn't necessarily on the command-line. I've had java exec calls not go through a path search at all on some versions of java with some platforms. What do you think?

drdozer avatar Jun 10 '15 20:06 drdozer

Agreed that making it configurable or assuming it's on the path is better than hardcoding the location, since it puts the user in control. Do you think something is needed to make it more easily configurable? To maintain parity with the existing api, maybe a companion helper?

// library code
object Exec {
  def apply(binary: File) = new Exec { 
    val dotBinary = binary 
  }
}

// user code
val customExec = Exec("/usr/local/bin/dot")
import customExec._

joprice avatar Jun 16 '15 02:06 joprice

Or an akka-style config file? I think they are complementary options, actually. I like your Exec import trick for user-override of the binary location. If you could code this one up in this pull request, then I'll merge it in.

drdozer avatar Jun 16 '15 16:06 drdozer

Updated with the helper.

joprice avatar Jun 17 '15 05:06 joprice

@drdozer Think this one is ready? Simmering for 4 years. Nice and congealed.

joprice avatar Feb 28 '19 15:02 joprice