Theory Version

theory Version
imports Main
theory Version
  imports Main
begin

text ‹This code was taken from IsaFoR and adapted to git. ›
local_setup ‹
  let
    val version =
      trim_line (#1 (Isabelle_System.bash_output ("cd $ISAFOL/ && git rev-parse --short HEAD || echo unknown")))
  in
    Local_Theory.define
      ((\<^binding>‹version›, NoSyn),
        ((\<^binding>‹version_def›, []), HOLogic.mk_literal version)) #> #2
  end
›

declare version_def [code]

end