Skip to content

Commit 4421dea

Browse files
committed
make sure we patch all elements in nuspec not just the first match
1 parent b111e26 commit 4421dea

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

build/scripts/Releasing.fsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,27 @@ module Release =
9999
let iconNode = doc.XPathSelectElement("/x:package/x:metadata/x:iconUrl", nsManager)
100100
iconNode.Value <- replace "icon" "icon-aux" iconNode.Value
101101
let xmlConfig = sprintf "/x:package//x:file[contains(@src, '%s.xml')]" p.Name
102-
doc.XPathSelectElement(xmlConfig, nsManager).Remove();
102+
doc.XPathSelectElements(xmlConfig, nsManager).Remove();
103103

104104
let dll n = sprintf "%s.dll" n
105105
let rewriteDllFile name =
106106
let d = dll name
107107
let r = (dll (p.Versioned name (Some currentMajorVersion)))
108108
let x = sprintf "/x:package//x:file[contains(@src, '%s')]" d
109-
let dllNode = doc.XPathSelectElement(x, nsManager)
110-
let src = dllNode.Attribute(xName "src");
111-
src.Value <- replace d r src.Value
109+
let dllNodes = doc.XPathSelectElements(x, nsManager)
110+
dllNodes |> Seq.iter (fun e ->
111+
let src = e.Attribute(xName "src");
112+
src.Value <- replace d r src.Value
113+
)
112114

113115
match p with
114116
| Project Nest ->
115117
let esDeps = doc.XPathSelectElements("/x:package/x:metadata//x:dependency[@id='Elasticsearch.Net']", nsManager);
116118
esDeps |> Seq.iter (fun e ->
117119
let esDep = e.Attribute(xName "id");
118120
esDep.Value <- sprintf "Elasticsearch.Net.v%s" currentMajorVersion
119-
rewriteDllFile p.Name
120121
)
122+
rewriteDllFile p.Name
121123
| Project ElasticsearchNet ->
122124
rewriteDllFile p.Name
123125
ignore()

0 commit comments

Comments
 (0)