Daml SDK version for a given DAR?

How can I determine the Daml SDK version of a given DAR?

On macOS, using grep:

> daml damlc inspect-dar some.dar \
    | grep --only-matching '^daml-stdlib-\d*\.\d*\.\d*'

daml-stdlib-2.8.5

On macOS, using sed:

> daml damlc inspect-dar some.dar \
    | sed -n 's/^daml-stdlib-\([0-9]*\.[0-9]*\.[0-9]*\)-.*$/\1/p'

2.8.5
2 Likes