Skip to content

Instantly share code, notes, and snippets.

@nahidacm
Last active July 18, 2020 02:47
Show Gist options
  • Save nahidacm/1867395babb04fe9c7e66964a2b75294 to your computer and use it in GitHub Desktop.
Save nahidacm/1867395babb04fe9c7e66964a2b75294 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "extra" ]; then
start_msg="Starting napa extra"
else
start_msg="Starting napa"
fi
echo $start_msg
rm -rf var/cache/*
rm -rf generated/metadata/*
rm -rf generated/code/*
rm -rf var/view_preprocessed/*
rm -rf pub/static/*
if [ "$1" == "extra" ]; then
bin/magento c:f
bin/magento setup:static-content:deploy -f
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento indexer:reindex
fi
if [ "$1" == "di" ]; then
bin/magento setup:di:compile
fi
if [ "$1" == "cud" ]; then
bin/magento c:f
bin/magento setup:upgrade
bin/magento setup:di:compile
fi
if [ "$1" == "dc" ]; then
bin/magento setup:di:compile
bin/magento c:f
fi
echo 'Done.'
#echo $PATH
#Download this script to any of the Path preferrably cd /usr/bin
#sudo wget https://gist.githubusercontent.com/nahidacm/1867395babb04fe9c7e66964a2b75294/raw/3e1a5a1eb1d9e0f4d52c0c76611afed93a44b050/napa
#cd to that path
#sudo chmod +x napa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment