e60458793ab9703bb65adb6c326f43c6bd5fd126

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

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.

Diff

 1diff --git a/plugins/cake/cake.plugin.zsh b/plugins/cake/cake.plugin.zsh
 2index 44cc47470200264729bd9e8d745683aa80037344..2370df9493238f90249cb63473a29783fc981c3d 100644
 3--- a/plugins/cake/cake.plugin.zsh
 4+++ b/plugins/cake/cake.plugin.zsh
 5@@ -15,7 +15,7 @@ _cake_does_target_list_need_generating () {
 6 	fi
 7 
 8 	[ ! -f ${_cake_task_cache_file} ] && return 0;
 9-	[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
10+	[ Cakefile -nt ${_cake_task_cache_file} ] && return 0;
11 	return 1;
12 }
13