简体   繁体   English

F#FAKE WixHelper使用fileFilter

[英]F# FAKE WixHelper use fileFilter

Looking at the WixHelper for F# documentation it looks like I can pass in a -filter parameter. 查看WixHelper for F#文档,看来我可以传递-filter参数。 I am still learning F# and I can't figure out how this method is supposed to work. 我仍在学习F#,无法弄清楚这种方法应该如何工作。

https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/WiXHelper.fs#L60-60 https://github.com/fsharp/FAKE/blob/master/src/app/FakeLib/WiXHelper.fs#L60-60

METHOD 方法

wixDir fileFilter asSubDir directoryInfo wixDir fileFilter asSubDir目录信息

I am trying to adapt this call to filter out *.exe (I do not want to include them). 我正在尝试使此调用适应以滤除* .exe(我不想包括它们)。

 wixDir (fun file -> true) true (DirectoryInfo (buildDir @@ "/SetupFiles"))

You just need to change (fun file -> true) to only return true when the file doesn't end with ".exe" I assume file is a FileInfo , so you would check if the file extension is "exe". 您只需要更改(fun file -> true)以仅在文件不以“ .exe”结尾时返回true(我假设fileFileInfo ,所以您将检查文件扩展名是否是“ exe”)。 I haven't tested this, but it should be something like this: 我没有测试过,但是应该是这样的:

(fun file -> not (file.Extension = ".exe"))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM