Last active
July 21, 2020 06:48
-
-
Save haljeshi/5f4c8243792b96731efddca4aa77c7f1 to your computer and use it in GitHub Desktop.
I use this shell script whenever Magento 2 is behaving strangely. It takes a long time to execute (mainly due to deploying static content), but it's a good last resort which usually solve my problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RED='\033[0;31m' | |
NC='\033[0m' | |
echo "${RED}Deleting pub/static ${NC}" | |
rm -r pub/static/* | |
echo "${RED}Deleting var/cache ${NC}" | |
rm -r var/cache/ | |
echo "${RED}Deleting var/composer_home ${NC}" | |
rm -r var/composer_home/ | |
echo "${RED}Deleting var/generation ${NC}" | |
rm -r var/generation/ | |
echo "${RED}Deleting var/page_cache ${NC}" | |
rm -r var/page_cache/ | |
echo "${RED}Deleting var/view_preprocessed ${NC}" | |
rm -r var/view_preprocessed/ | |
echo "${RED}Upgrading... ${NC}" | |
bin/magento setup:upgrade | |
echo "${RED}Compiling... ${NC}" | |
bin/magento setup:di:compile | |
echo "${RED}Deploying... ${NC}" | |
bin/magento setup:static-content:deploy -f | |
echo "${RED}chowing...${NC}" | |
sudo chown -R $USER:www-data . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment