Use `xargs`, instead of `for`.

This commit is contained in:
Kazuhiro MUSASHI 2020-05-01 00:42:01 +09:00
parent 3478c90104
commit 30310d143a
1 changed files with 4 additions and 4 deletions

View File

@ -17,8 +17,8 @@ steps:
- name: Compress-the-Assets
image: alpine:3.9
commands:
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
- for TARGET in `find public/ -type f | egrep "\.(html|HTML)$"`; 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 %'
- find public/ -type f | egrep "\.(html|HTML)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
- name: housekeep
image: appleboy/drone-ssh
@ -71,8 +71,8 @@ steps:
- name: Compress-the-Assets
image: alpine:3.9
commands:
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
- for TARGET in `find public/ -type f | egrep "\.(html|HTML)$"`; 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 %'
- find public/ -type f | egrep "\.(html|HTML)$" | xargs -n 1 -i% -P 0 -t sh -c 'cp % %.bk && gzip % && mv %.bk %'
- name: housekeep
image: appleboy/drone-ssh