Skip to content

Commit e0951af

Browse files
committed
Write sha2 files
1 parent 3142a30 commit e0951af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build.fsx

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
open System
77
open System.IO
88
open System.Net
9+
open System.Security.Cryptography
910
open System.Threading.Tasks
1011

1112
open Microsoft.WindowsAzure.Storage
@@ -134,6 +135,17 @@ Target "Zip" (fun _ ->
134135
!! (buildDirNoRuntime @@ @"/**/*.*")
135136
|> (fun f -> List.fold (--) f excludedFiles)
136137
|> Zip buildDirNoRuntime (deployDir @@ "Azure.Functions.Cli.no-runtime." + npmVersion + ".zip")
138+
139+
let getSha2 filePath =
140+
File.ReadAllBytes (filePath)
141+
|> (new SHA256Managed()).ComputeHash
142+
|> BitConverter.ToString
143+
|> fun x -> x.Replace("-", String.Empty)
144+
145+
Directory.GetFiles (deployDir)
146+
|> Array.iter (fun file ->
147+
let sha2 = getSha2 file
148+
File.WriteAllText (file + ".sha2", sha2))
137149
)
138150

139151
type SigningInfo =

0 commit comments

Comments
 (0)