mirror of
https://github.com/spirit-x64/scripts.git
synced 2024-11-23 20:53:11 +03:00
accept an arguement as an html path
This commit is contained in:
parent
c64c078365
commit
8548bd4ce3
@ -9,7 +9,14 @@ command -v uglifyjs >/dev/null 2>&1 || { echo "Error: to install missing deps ru
|
||||
command -v cleancss >/dev/null 2>&1 || { echo "Error: to install missing deps run: npm i -g html-minifier uglify-js cleancss svgo" >&2; exit 1; }
|
||||
command -v svgo >/dev/null 2>&1 || { echo "Error: to install missing deps run: npm i -g html-minifier uglify-js cleancss svgo" >&2; exit 1; }
|
||||
|
||||
html_file=index.html
|
||||
if [[ $# -eq 0 ]]; then
|
||||
html_file=index.html
|
||||
else
|
||||
html_file="$1"
|
||||
dir=$PWD
|
||||
cd $(dirname $html_file)
|
||||
html_file=$(basename $html_file)
|
||||
fi
|
||||
|
||||
if [[ -f "$html_file" ]]; then
|
||||
awk '
|
||||
@ -65,6 +72,6 @@ if [[ -f "$html_file" ]]; then
|
||||
echo generated "min.${html_file}"
|
||||
fi
|
||||
|
||||
|
||||
# Clean up generated files
|
||||
rm min.*.js min.*.css min.*.svg "${html_file}.tmp"
|
||||
cd $dir
|
||||
|
Loading…
Reference in New Issue
Block a user