Skip to content

Instantly share code, notes, and snippets.

@vanzhiganov
Created December 11, 2019 12:51
Show Gist options
  • Save vanzhiganov/e7bd45b7d7d10349d7c58d04c9cb5f7c to your computer and use it in GitHub Desktop.
Save vanzhiganov/e7bd45b7d7d10349d7c58d04c9cb5f7c to your computer and use it in GitHub Desktop.
#!/bin/sh
rm -rf /home/project/*
FOLDER=/home/project
cp ./*.php $FOLDER
cp -r css img js $FOLDER
FILES=$(find css js templates -type f -regex '.*.\(js\|css\|twig\)')
for f in $FILES; do
echo "$f"|grep twig 1>/dev/null
r=$?
if [ "$r" -eq 0 ]; then
minify --type html "$f" --output $FOLDER
else
minify "$f" --output $FOLDER
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment