mirror of
https://github.com/spirit-x64/scripts.git
synced 2025-01-18 22:31:45 +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 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; }
|
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
|
if [[ -f "$html_file" ]]; then
|
||||||
awk '
|
awk '
|
||||||
@ -65,6 +72,6 @@ if [[ -f "$html_file" ]]; then
|
|||||||
echo generated "min.${html_file}"
|
echo generated "min.${html_file}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Clean up generated files
|
# Clean up generated files
|
||||||
rm min.*.js min.*.css min.*.svg "${html_file}.tmp"
|
rm min.*.js min.*.css min.*.svg "${html_file}.tmp"
|
||||||
|
cd $dir
|
||||||
|
Loading…
Reference in New Issue
Block a user