Skip to content

Commit 41c06b5

Browse files
committed
Paket pack failed when project container Compile Update entries -fixes #3752
1 parent 1319c7a commit 41c06b5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Paket.Core/PaketConfigFiles/ProjectFile.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,9 +2018,15 @@ type ProjectFile with
20182018
let getCompileItem (projectFile, compileNode) =
20192019
let projectFolder = projectFile.FileName |> Path.GetFullPath |> Path.GetDirectoryName
20202020
let sourceFile =
2021-
compileNode
2022-
|> getAttribute "Include"
2023-
|> fun attr -> attr.Value
2021+
let file =
2022+
match compileNode |> getAttribute "Include" with
2023+
| Some file -> file
2024+
| None ->
2025+
match compileNode |> getAttribute "Update" with
2026+
| Some file -> file
2027+
| None -> failwithf "The Compile entry is in unknown format and doesn't contain a Update or Include attribute."
2028+
2029+
file
20242030
|> normalizePath
20252031
|> fun relPath -> Path.Combine(projectFolder, relPath)
20262032

0 commit comments

Comments
 (0)