diff --git a/app/dictionary-tools.gradle b/app/dictionary-tools.gradle index 2241bb0b..7ca4d45a 100644 --- a/app/dictionary-tools.gradle +++ b/app/dictionary-tools.gradle @@ -56,10 +56,16 @@ class Wrapper { static def getLanguageHash(File definitionFile, File dictionaryFile) { - def definitionHash = definitionFile != null && definitionFile.exists() ? definitionFile.text.digest("SHA-256") : "" - def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? dictionaryFile.text.digest("SHA-256") : "" + def definitionHash = definitionFile != null && definitionFile.exists() ? sha256(definitionFile.path) : "" + def dictionaryHash = dictionaryFile != null && dictionaryFile.exists() ? sha256(dictionaryFile.path) : "" return definitionHash + dictionaryHash } + + + static def sha256(String filePath) { + def parts = "sha256sum $filePath".execute().text.trim().split(" ") + return parts.length > 0 ? parts[0] : "" + } } ext.DictionaryTools = Wrapper