Skip to content

Commit 68c904e

Browse files
committed
Add additional fallback handling for getting the Version
1 parent 1cf6b6b commit 68c904e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Fornax/Fornax.fs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,13 @@ let main argv =
274274
0
275275
| Some Version ->
276276
let assy = Assembly.GetExecutingAssembly()
277-
let v = assy.GetCustomAttributes<AssemblyVersionAttribute>() |> Seq.head
278-
printfn "%s" v.Version
277+
let version =
278+
assy.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
279+
|> Option.ofObj
280+
|> Option.map _.InformationalVersion
281+
|> Option.defaultValue (assy.GetName().Version.ToString())
282+
283+
printfn "%s" version
279284
0
280285
| Some Clean ->
281286
let publ = Path.Combine(cwd, "_public")

0 commit comments

Comments
 (0)