roxy icon indicating copy to clipboard operation
roxy copied to clipboard

MLCP not found in PATH

Open netdance opened this issue 11 years ago • 10 comments

ml local mlcp requires that mlcp either be in a well known location, or that an entry be added in local.properties.

It would be far better to have it just determine for itself if mlcp is already on the system.

The easiest way would be to look for the PATH env variable, and search for mlcp.sh or mlcp.bat. From there, it's simple to get the path to the jar files.

Alternately, just download the jars and dependancies from maven. Or just use http to download and install the jars into the project, the first time the mlcp command is run.

netdance avatar May 27 '14 15:05 netdance

There might be good reason to want to pick a different mlcp for Roxy. Searching PATH could be an interesting fall-back though. Found a pure-Ruby implementation of 'which' that could be useful to derive mlcp-home from mlcp 'exe':

http://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby

Downloading jars would cause jars to be duplicated for each project. Would add several mb's to each project, with the risk of them getting checked in as well. I would prefer using a global mlcp..

grtjn avatar May 28 '14 09:05 grtjn

Ran into this on Windows. Gave the a not very intuitive error (esp for those with low experience with roxy/MLCP). Any word on this happening?

hunterwilliams avatar Sep 04 '15 16:09 hunterwilliams

Added to next milestone. On my wish list for a while, but not sure I have time to look into it before tech summit..

grtjn avatar Sep 04 '15 17:09 grtjn

Alt might be to have our slush generator search for mlcp, and fix mlcp-home for us.. :P

grtjn avatar Sep 04 '15 17:09 grtjn

Then again, that will only work for the person that actually ran that generator, so not my favorite..

grtjn avatar Sep 04 '15 17:09 grtjn

Yeah that would be annoying and just cause git issues.

Unless there was possibly a task added to gulp to generate the file locally but that seems sorta complex..

hunterwilliams avatar Sep 04 '15 17:09 hunterwilliams

well, could fit into my ideas about https://github.com/marklogic/slush-marklogic-node/issues/151. I'd love to put all those generator options in local.json, next to a defaults.json or something like that. And then make Roxy use those too. Not sure how easy that will be..

grtjn avatar Sep 04 '15 17:09 grtjn

Simplest way of reading JSON (using core gems):

require 'yaml'
items = YAML.load_file('local.json')
items.each do |key, item|
  puts "#{key}:#{item}"
end

Should be easy enough to integrate that into Roxy. If necessary through app_specific (for easier use in slush-marklogic-node)..

grtjn avatar Sep 04 '15 18:09 grtjn

#515 could provide a way around, but I still like the idea searching path for mlcp.sh/.bat..

grtjn avatar Sep 17 '15 21:09 grtjn

Pushing this away for the moment though..

grtjn avatar Sep 17 '15 21:09 grtjn