Skip to content

Instantly share code, notes, and snippets.

@navarr
Created November 7, 2017 16:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navarr/e9f115eb42b1634d20f60c6dd8ffd322 to your computer and use it in GitHub Desktop.
Save navarr/e9f115eb42b1634d20f60c6dd8ffd322 to your computer and use it in GitHub Desktop.
Magento Helper Functions
# Clear & regenerate CSS
refreshcss() {
find /var/www/Magento/pub/static/frontend -name "*.css" -type f -delete
find /var/www/Magento/pub/static/_cache -name "*.css" -type f -delete
find /var/www/Magento/var/view_preprocessed -name "*.less" -type f -delete
find /var/www/Magento/var/view_preprocessed -name "*.css" -type f -delete
/var/www/Magento/bin/magento setup:static-content:deploy -t SDBullion/twentyseventeen --no-html-minify
/var/www/Magento/bin/magento cache:flush full_page
date
}
refreshfiles() {
for var in "$@"
do
find /var/www/Magento/pub/static/frontend -name "$var" -type f -delete
done
/var/www/Magento/bin/magento setup:static-content:deploy -t SDBullion/twentyseventeen --no-html-minify
/var/www/Magento/bin/magento cache:flush full_page
date
}
refreshfilesandcss() {
for var in "$@"
do
find /var/www/Magento/pub/static/frontend -name "$var" -type f -delete
done
find /var/www/Magento/pub/static/frontend -name "*.css" -type f -delete
rm -rf /var/www/Magento/var/view_preprocessed/
/var/www/Magento/bin/magento setup:static-content:deploy -t SDBullion/twentyseventeen --no-html-minify
/var/www/Magento/bin/magento cache:flush full_page
date
}
refreshall() {
rm -rf /var/www/Magento/pub/static/frontend /var/www/Magento/pub/static/_requirejs /var/www/Magento/var/view_preprocessed
/var/www/Magento/bin/magento setup:static-content:deploy -t SDBullion/twentyseventeen --no-html-minify
/var/www/Magento/bin/magento cache:flush full_page
date
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment