Skip to content

Instantly share code, notes, and snippets.

@joewiz
Last active December 19, 2022 20:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewiz/6a157163034a3111dcf72346af36470b to your computer and use it in GitHub Desktop.
Save joewiz/6a157163034a3111dcf72346af36470b to your computer and use it in GitHub Desktop.
Populate version info for the eXist issue tracker
xquery version "3.1";
(: Note: the environment-variable functions only work if the user running the query has DBA access :)
(: Probe available environment variables with the following query :)
(:
map:merge(
available-environment-variables() ! map:entry(., environment-variable(.))
),
:)
string-join(
(
"- " || system:get-product-name() || " version + Git Revision hash: eXist " || system:get-version() || "+" || system:get-revision() || " (build " || system:get-build() || ")",
"- Java version: " || (environment-variable("JAVA_HOME") => tokenize("/"))[matches(., "\d+\.\d+\.\d+")],
"- Operating system: " || environment-variable("_system_name") || " " || environment-variable("_system_version"),
"- 32 or 64 bit: " || environment-variable("_system_arch"),
"- Any custom changes in e.g. conf.xml: "
),
"
")
- eXist version + Git Revision hash: eXist 3.5.0-SNAPSHOT+0875a60cc (build 201709211530)
- Java version: jdk1.8.0_144.jdk
- Operating system: OSX 10.12
- 32 or 64 bit: x86_64
- Any custom changes in e.g. conf.xml:
@line-o
Copy link

line-o commented Dec 19, 2022

to get around the hard-coded "eXist" you can incorporate system:get-product-name()

@joewiz
Copy link
Author

joewiz commented Dec 19, 2022

@line-o Thanks! I've updated the code to use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment