jgo
jgo copied to clipboard
Shell script behaves badly when repeatedly executing endpoint with no mainClass
Example:
$ jgo org.scijava:scijava-common
No main class given, and none found.
$ jgo org.scijava:scijava-common
ln: /Users/curtis/.jgo/org.scijava/scijava-common/parsington-1.0.3.jar: File exists
cp: /Users/curtis/.jgo/org.scijava/scijava-common/parsington-1.0.3.jar and /Users/curtis/.m2/repository/org/scijava/parsington/1.0.3/parsington-1.0.3.jar are identical (not copied).
Cannot copy '/Users/curtis/.m2/repository/org/scijava/parsington/1.0.3/parsington-1.0.3.jar' into jgo workspace '/Users/curtis/.jgo/org.scijava/scijava-common'
No main class given, and none found.
I think this happens because jgo looks for the existence of a mainClass stub file, and acts based on that. But if no main was found for an endpoint, no mainClass gets written. Perhaps we should write an empty one and then test for content instead?
@hanslovsky and I decided the fix will be to behave as though -u is passed whenever no mainClass is present.