How to write a gradle task that shows the difference between 2 commits in git and export the difference in a txt file?
I tried to create the task below but the task doesn’t seem to export into a txt file.
task diffLiterals() {
description = 'get the difference between 2 commits in the literals.csv'
def cmd = 'git diff HEAD^ HEAD --no-ext-diff model/localizations/literals-en.csv > test.txt'
def diffFile = cmd.execute()
}
Running the git command itself in a terminal works fine though.
git diff HEAD^ HEAD --no-ext-diff model/localizations/literals-en.csv > diff.txt