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
dda1154c
Commit
dda1154c
authored
Apr 07, 2013
by
Robby Russell
Browse files
Merge pull request #1655 from nubs/phing-and-cache-files
Improve portability of cache file detection for command targets
parents
e041b507
bdf4f5a3
Changes
4
Show whitespace changes
Inline
Side-by-side
plugins/ant/ant.plugin.zsh
View file @
dda1154c
stat
-f
%m
.
>
/dev/null 2>&1
if
[
"
$?
"
=
0
]
;
then
stat_cmd
=(
stat
-f
%m
)
else
stat_cmd
=(
stat
-L
--format
=
%Y
)
fi
_ant_does_target_list_need_generating
()
{
if
[
!
-f
.ant_targets
]
;
then return
0
;
else
accurate
=
$(
$stat_cmd
.ant_targets
)
changed
=
$(
$stat_cmd
build.xml
)
return
$(
expr
$accurate
'>='
$changed
)
fi
[
!
-f
.ant_targets
]
&&
return
0
;
[
.ant_targets
-nt
build.xml
]
&&
return
0
;
return
1
;
}
_ant
()
{
...
...
plugins/cake/cake.plugin.zsh
View file @
dda1154c
...
...
@@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () {
return
1
;
fi
if
[
!
-f
${
_cake_task_cache_file
}
]
;
then return
0
;
else
accurate
=
$(
stat
-f
%m
$_cake_task_cache_file
)
changed
=
$(
stat
-f
%m Cakefile
)
return
$(
expr
$accurate
'>='
$changed
)
fi
[
!
-f
${
_cake_task_cache_file
}
]
&&
return
0
;
[
${
_cake_task_cache_file
}
-nt
Cakefile
]
&&
return
0
;
return
1
;
}
_cake
()
{
...
...
plugins/gradle/gradle.plugin.zsh
View file @
dda1154c
...
...
@@ -54,27 +54,14 @@ function in_gradle() {
fi
}
############################################################################
# Define the stat_cmd command based on platform behavior
##########################################################################
stat
-f
%m
.
>
/dev/null 2>&1
if
[
"
$?
"
=
0
]
;
then
stat_cmd
=(
stat
-f
%m
)
else
stat_cmd
=(
stat
-L
--format
=
%Y
)
fi
############################################################################## Examine the build.gradle file to see if its
# timestamp has changed, and if so, regen
# the .gradle_tasks cache file
############################################################################
_gradle_does_task_list_need_generating
()
{
if
[
!
-f
.gradletasknamecache
]
;
then return
0
;
else
accurate
=
$(
$stat_cmd
.gradletasknamecache
)
changed
=
$(
$stat_cmd
build.gradle
)
return
$(
expr
$accurate
'>='
$changed
)
fi
[
!
-f
.gradletasknamecache
]
&&
return
0
;
[
.gradletasknamecache
-nt
build.gradle
]
&&
return
0
;
return
1
;
}
...
...
plugins/phing/phing.plugin.zsh
View file @
dda1154c
_phing_does_target_list_need_generating
()
{
if
[
!
-f
.phing_targets
]
;
then return
0
;
else
accurate
=
$(
stat
-f
%m .phing_targets
)
changed
=
$(
stat
-f
%m build.xml
)
return
$(
expr
$accurate
'>='
$changed
)
fi
[
!
-f
.phing_targets
]
&&
return
0
;
[
.phing_targets
-nt
build.xml
]
&&
return
0
;
return
1
;
}
_phing
()
{
if
[
-f
build.xml
]
;
then
if
_phing_does_target_list_need_generating
;
then
phing
-l
|grep
-v
":"
|grep
-v
"^
$"
|grep
-v
"
\-
"
>
.phing_targets
phing
-l
|grep
-v
":
$
"
|grep
-v
"^
-*$
"
>
.phing_targets
fi
compadd
`
cat
.phing_targets
`
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