Use `xargs`, instead of `for`.
This commit is contained in:
parent
3478c90104
commit
30310d143a
|
@ -17,8 +17,8 @@ steps:
|
||||||
- name: Compress-the-Assets
|
- name: Compress-the-Assets
|
||||||
image: alpine:3.9
|
image: alpine:3.9
|
||||||
commands:
|
commands:
|
||||||
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
|
- find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
|
||||||
- for TARGET in `find public/ -type f | egrep "\.(html|HTML)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
|
- find public/ -type f | egrep "\.(html|HTML)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
|
||||||
|
|
||||||
- name: housekeep
|
- name: housekeep
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
|
@ -71,8 +71,8 @@ steps:
|
||||||
- name: Compress-the-Assets
|
- name: Compress-the-Assets
|
||||||
image: alpine:3.9
|
image: alpine:3.9
|
||||||
commands:
|
commands:
|
||||||
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
|
- find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
|
||||||
- for TARGET in `find public/ -type f | egrep "\.(html|HTML)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
|
- find public/ -type f | egrep "\.(html|HTML)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
|
||||||
|
|
||||||
- name: housekeep
|
- name: housekeep
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
|
|
Loading…
Reference in New Issue