mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-07 18:37:56 -05:00
try weirder tricks for version generation
This commit is contained in:
parent
d974213376
commit
aa9e3f98ff
3 changed files with 19 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -7,3 +7,6 @@ _opam
|
||||||
*.install
|
*.install
|
||||||
*.exe
|
*.exe
|
||||||
*.tmp
|
*.tmp
|
||||||
|
src/lib/version.ml
|
||||||
|
src/lib/.git_index_path
|
||||||
|
src/lib/.git_index.lnk
|
||||||
|
|
|
||||||
15
src/lib/dune
15
src/lib/dune
|
|
@ -1,6 +1,19 @@
|
||||||
|
(rule
|
||||||
|
(target .git_index_path)
|
||||||
|
(deps (universe) gen_git_index_path.sh)
|
||||||
|
(action
|
||||||
|
(with-stdout-to
|
||||||
|
.git_index_path
|
||||||
|
(run sh gen_git_index_path.sh))))
|
||||||
|
|
||||||
|
(rule
|
||||||
|
(target .git_index.lnk)
|
||||||
|
(action
|
||||||
|
(run ln -sf %{read-lines:.git_index_path} %{target})))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(target version.ml)
|
(target version.ml)
|
||||||
(deps (universe) gen_version.sh)
|
(deps (file .git_index.lnk) gen_version.sh)
|
||||||
(action
|
(action
|
||||||
(with-stdout-to
|
(with-stdout-to
|
||||||
version.ml
|
version.ml
|
||||||
|
|
|
||||||
2
src/lib/gen_git_index_path.sh
Normal file
2
src/lib/gen_git_index_path.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
git rev-parse --git-path index 2>/dev/null || echo /dev/null
|
||||||
Loading…
Add table
Reference in a new issue