From 64d53abd61f09958ddac0586d17110ed93f47ccb Mon Sep 17 00:00:00 2001 From: "derks.patrick" Date: Thu, 15 Apr 2021 18:39:36 +0200 Subject: [PATCH] added function to write requirement hash to file --- api/tasks/runner.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/tasks/runner.go b/api/tasks/runner.go index e53af43f..c816a79b 100644 --- a/api/tasks/runner.go +++ b/api/tasks/runner.go @@ -551,6 +551,15 @@ func hasRequirementsChanges(requirementsFilePath string, requirementsHashFilePat return string(oldFileMD5HashBytes) != newFileMD5Hash } +func writeMD5Hash(requirementsFile string, requirementsHashFile string) error { + newFileMD5Hash, err := helpers.GetMD5Hash(requirementsFile) + if err != nil { + return err + } + + return ioutil.WriteFile(requirementsHashFile, []byte(newFileMD5Hash), 0644) +} + // extractCommandEnvironment unmarshalls a json string, extracts the ENV key from it and returns it as // []string where strings are in key=value format func extractCommandEnvironment(envJSON string) []string {