Created
April 24, 2017 08:19
-
-
Save Slesa/960b2c61d9832eeb262067b9882c2093 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Special directory syntax: | |
bin\Program | |
bin\Application | |
... | |
bin\Config | |
let deployDir = "bin\deploy\" | |
let createZip is64bit (dirInfo: DirectoryInfo) = | |
let dirName = dirInfo.Name | |
if not (System.String.Equals(dirName, "config", System.StringComparison.CurrentCultureIgnoreCase)) then | |
let dirPath = dirInfo.FullName | |
// Configuration files | |
let cfgName = dirPath @@ ".." @@ "Config" @@ (dirName + ".cfg") | |
// Error description | |
let errName = dirPath @@ ".." @@ "Config" @@ (dirName + "Error.cfg") | |
// Extra data files | |
let dataMap = dict["Program", [dirPath @@ ".." @@ "data/Reboot.ini"]] | |
let dataFiles = if Seq.contains dirName dataMap.Keys then dataMap.Item(dirName) else List.empty | |
let zipName = deployDir @@ (dirName + (if is64bit then "64" else "") + ".zip") | |
let appFiles = | |
!! ( dirPath @@ "/**/*") | |
++ clgName | |
++ errName | |
(Seq.toList appFiles) @ dataFiles | |
|> Zip (dirPath @@ "..") zipName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment