feat: verify by checksum and remove if invalid

This commit is contained in:
James Houlahan
2020-12-02 16:31:03 +01:00
parent 98ab794f13
commit eccad4bbfd
11 changed files with 372 additions and 66 deletions

View File

@ -149,7 +149,12 @@ func getPathToExecutable(name string, versioner *versioner.Versioner, kr *crypto
vlog := logrus.WithField("version", version)
if err := version.VerifyFiles(kr); err != nil {
vlog.WithError(err).Error("Failed to verify files")
vlog.WithError(err).Error("Files failed verification and will be removed")
if err := version.Remove(); err != nil {
vlog.WithError(err).Error("Failed to remove files")
}
continue
}