Skip to content

Commit bf130f3

Browse files
Drop wc dependency, minor refactor
1 parent 87f7837 commit bf130f3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

minify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ do
5151
if [ "${filename}.min.${filetype}" -ot "${filename}.${filetype}" ]; then
5252
do_min=1
5353
fi
54-
elif [ "$(wc -l "$filename.$filetype" | awk '{print $1}')" -ge 15 ] || [ "$(grep -Ec $'^(\t|\ )' "$filename.$filetype")" -ge 5 ]; then
54+
elif [ "$(awk 'END{print NR}' "$filename.$filetype")" -ge 15 ] || [ "$(grep -Ec $'^(\t|\ )' "$filename.$filetype")" -ge 5 ]; then
5555
do_min=1
5656
fi
5757
MAP_OP=""

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Web minify helper!
66

77
Let me help you minify css and js files automatically and easily!
88

9-
This is only a shell script; it depends on bash shell, grep, wc, curl and nodejs/npm.
9+
This is only a shell script; it depends on bash shell, grep, curl and nodejs/npm.
1010

1111
It is based on [clean-css](https://github.com/jakubpawlowicz/clean-css), [uglify-js](https://github.com/mishoo/UglifyJS2) and [javascript-minifier.com](https://javascript-minifier.com)/[cssminifier.com](https://cssminifier.com).
1212

@@ -16,7 +16,6 @@ Requirements
1616
========
1717
- Bash shell
1818
- grep
19-
- wc (word count)
2019
- curl
2120
- Node.js >= (4.0)
2221

0 commit comments

Comments
 (0)