9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-10-10 18:01:30 +02:00
qp2/ocaml/create_git_sha1.sh

13 lines
321 B
Bash
Raw Normal View History

2019-01-25 11:39:31 +01:00
#!/bin/bash
SHA1=$(git log -1 | head -1 | cut -d ' ' -f 2)
DATE=$(git log -1 | grep Date | cut -d ':' -f 2-)
MESSAGE=$(git log -1 | tail -1 | sed 's/"/\\"/g')
cat << EOF > Git.ml
open Core
let sha1 = "$SHA1" |> String_ext.strip
let date = "$DATE" |> String_ext.strip
let message = "$MESSAGE" |> String_ext.strip
EOF