Thank you, everyone, and if you're happy discussing this as a point of interest please don't let me stop you, but I'm not particularly worried about running it as one combined command, provided I can get Mafia to run. As I say, my own understanding of how Gradle works is a bit limited!
So, I have a zsh script that runs every morning at 5am (for me…), that checks a Mafia process isn't already running, backs up my preferences, moods and combat scripts, then CDs to the KoLMafia folder, runs 'git pull origin main', then './gradlew clean' and './gradlew runshadow'. That now seems to work. This normally all happens in the background, and I emerge from my bed, and lo—Mafia awaits!
There might well be a better way. Thanks for the help!