Skip to content

Commit

Permalink
Write sha2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmelsayed committed Jul 23, 2018
1 parent 3142a30 commit e0951af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
open System
open System.IO
open System.Net
open System.Security.Cryptography
open System.Threading.Tasks

open Microsoft.WindowsAzure.Storage
Expand Down Expand Up @@ -134,6 +135,17 @@ Target "Zip" (fun _ ->
!! (buildDirNoRuntime @@ @"/**/*.*")
|> (fun f -> List.fold (--) f excludedFiles)
|> Zip buildDirNoRuntime (deployDir @@ "Azure.Functions.Cli.no-runtime." + npmVersion + ".zip")

let getSha2 filePath =
File.ReadAllBytes (filePath)
|> (new SHA256Managed()).ComputeHash
|> BitConverter.ToString
|> fun x -> x.Replace("-", String.Empty)

Directory.GetFiles (deployDir)
|> Array.iter (fun file ->
let sha2 = getSha2 file
File.WriteAllText (file + ".sha2", sha2))
)

type SigningInfo =
Expand Down

0 comments on commit e0951af

Please sign in to comment.