diff --git a/JythonCli.java b/JythonCli.java index a9210dc..74b0852 100755 --- a/JythonCli.java +++ b/JythonCli.java @@ -77,6 +77,12 @@ static String getJvmMajorVersion() { * @throws IOException */ void initEnvironment(String[] args) throws IOException { + // Set Jython version to jbang.app.version property if set, otherwise use default + String version = System.getProperty("jbang.app.version"); + if (version != null) { + jythonVersion = version; + } + // Check that that Java 8 (1.8) or higher is used if (Integer.parseInt(javaVersion) < 8) { System.err.println("jython-cli: error, Java 8 or higher is required"); diff --git a/jbang-catalog.json b/jbang-catalog.json index 4c004f3..97ed70b 100644 --- a/jbang-catalog.json +++ b/jbang-catalog.json @@ -2,7 +2,17 @@ "aliases": { "jython-cli": { "script-ref": "JythonCli.java", - "description": "Run Jython 2.7" + "description": "Run Jython 2.7", + "properties": { + "jbang.app.version": "2.7.4" + } + }, + "jython-cli-next": { + "script-ref": "JythonCli.java", + "description": "Run Jython 2.7.5b1", + "properties": { + "jbang.app.version": "2.7.5b1" + } } } }