From e60458793ab9703bb65adb6c326f43c6bd5fd126 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc=20Cornell=C3=A0?= <marc.cornella@live.com>
Date: Wed, 17 Dec 2014 11:11:53 +0100
Subject: [PATCH] Switch newer-than logic to get the desired behavior

In the old version, the function returned true (0) if the cache file
was newer than the Cakefile, which was *always* unless the Cakefile
had been updated. Therefore we generated the file every time unless
the Cakefile was updated, which was precisely when we needed to
regenerate the cache file.

Now it generates the cache file only when the Cakefile has been
updated.
---
 plugins/cake/cake.plugin.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
index 44cc47470..2370df949 100644
--- a/plugins/cake/cake.plugin.zsh
+++ b/plugins/cake/cake.plugin.zsh
@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
 	fi
 
 	[ ! -f ${_cake_task_cache_file} ] && return 0;
-	[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
+	[ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
 	return 1;
 }