Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
c09e2f29
Commit
c09e2f29
authored
Jul 18, 2011
by
Paul Serby
Browse files
Bringing inline with oh-my-zsh coding convensions
parent
66c6260c
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/cake/cake.plugin.zsh
View file @
c09e2f29
# Set this to 1 if you want to cache the tasks
cache
T
ask
L
ist
=
1
cache
_t
ask
_l
ist
=
1
# Cache filename
cache
F
ile
=
'.cake
-
task
-
cache'
cache
_f
ile
=
'.cake
_
task
_
cache'
_cake_does_target_list_need_generating
()
{
if
[
$cache
T
ask
L
ist
-eq
0
]
;
then
if
[
$cache
_t
ask
_l
ist
-eq
0
]
;
then
return
1
;
fi
if
[
!
-f
$cache
F
ile
]
;
then return
0
;
if
[
!
-f
$cache
_f
ile
]
;
then return
0
;
else
accurate
=
$(
stat
-f
%m
$cache
F
ile
)
accurate
=
$(
stat
-f
%m
$cache
_f
ile
)
changed
=
$(
stat
-f
%m Cakefile
)
return
$(
expr
$accurate
'>='
$changed
)
fi
...
...
@@ -21,8 +21,8 @@ _cake_does_target_list_need_generating () {
_cake
()
{
if
[
-f
Cakefile
]
;
then
if
_cake_does_target_list_need_generating
;
then
cake |
sed
-e
"s/cake
\(
[^ ]*
\)
.*/
\1
/"
|
grep
-v
'^$'
>
$cache
F
ile
compadd
`
cat
$cache
F
ile
`
cake |
sed
-e
"s/cake
\(
[^ ]*
\)
.*/
\1
/"
|
grep
-v
'^$'
>
$cache
_f
ile
compadd
`
cat
$cache
_f
ile
`
else
compadd
`
cake |
sed
-e
"s/cake
\(
[^ ]*
\)
.*/
\1
/"
|
grep
-v
'^$'
`
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment