Use find instead of ls for determining dir emptiness
ls foo/* isn't a great way to do this - but find, as is usually the case, solves all problems. Change-Id: Ic30b36ccee41e9b74e187eb3cdab0359f659a1c9
This commit is contained in:
parent
f711df6978
commit
3b9e295a37
@ -2,7 +2,7 @@
|
||||
when: zuul.change is defined
|
||||
delegate_to: localhost
|
||||
shell: |
|
||||
if [ -n $(ls {{ zuul.executor.work_root }}/{{ item }}) ] ; then
|
||||
if [ -n "$(find {{ zuul.executor.work_root }}/{{ item }} -mindepth 1)" ] ; then
|
||||
# Only create target directory if it is needed.
|
||||
# Do not fail if it is already there.
|
||||
mkdir -p {{ zuul.executor.log_root }}/{{ item }}
|
||||
|
Loading…
Reference in New Issue
Block a user