Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow setting module path.

  • Loading branch information...
commit 129f7a91b44073781c2cf7a42ce838285d27ac4d 1 parent d5f08da
@tschaub authored
View
9 bin/geoscript
@@ -49,6 +49,11 @@ else
CLASS=org.geoscript.js.GeoScriptShell
fi
+ARGS=
+if [ -x $MODULES ]; then
+ ARGS="-Dgeoscript.modules=$MODULES"
+fi
+
if [ $# -eq 1 ]; then
# resolve absolute path to main module
MAIN_PATH=$(
@@ -56,8 +61,8 @@ if [ $# -eq 1 ]; then
&& pwd -P
) && MAIN_PATH=$MAIN_PATH/$(basename -- "$1")
- java -cp $CP $CLASS -main $MAIN_PATH
+ java -cp $CP $ARGS $CLASS -main $MAIN_PATH
else
- java -cp $CP $CLASS
+ java -cp $CP $ARGS $CLASS
fi
View
14 src/main/java/org/geoscript/js/GeoScriptModules.java
@@ -6,12 +6,14 @@
public class GeoScriptModules {
public static String getModulePath() {
- URL moduleUrl = GeoScriptModules.class.getResource("lib");
- String modulePath;
- try {
- modulePath = moduleUrl.toURI().toString();
- } catch (URISyntaxException e) {
- throw new RuntimeException("Trouble evaluating GeoScript module path.", e);
+ String modulePath = System.getProperty("geoscript.modules");
+ if (modulePath == null) {
+ URL moduleUrl = GeoScriptModules.class.getResource("lib");
+ try {
+ modulePath = moduleUrl.toURI().toString();
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Trouble evaluating GeoScript module path.", e);
+ }
}
return modulePath;
}
Please sign in to comment.
Something went wrong with that request. Please try again.