Skip to content

Instantly share code, notes, and snippets.

@StenHigh
Last active May 29, 2019 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StenHigh/16c380a7ca18297d11987230d642c5ef to your computer and use it in GitHub Desktop.
Save StenHigh/16c380a7ca18297d11987230d642c5ef to your computer and use it in GitHub Desktop.
magento update static content
#!/usr/bin/env bash
while getopts d:e option
do
case "${option}"
in
d) DIRECTORY="${OPTARG}";;
e) ENV="${OPTARG}";;
esac
done
if [ -z ${DIRECTORY+x} ]; then
DIRECTORY = "/var/www/html/magento_dev"
fi
cwd=$(pwd)
if [ $cwd = $DIRECTORY ]; then
rm -rf pub/static/frontend/
echo -en '\033[0;32mdirectory "pub/static/frontend/\033[0m \n'
php bin/magento setup:static-content:deploy sv_SE
echo -en '\033[0;32mfrontend static created\033[0m \n'
rm -rf pub/static/adminhtml/
echo -en '\033[0;32mdirectory "pub/static/adminhtml/\033[0m \n'
php bin/magento setup:static-content:deploy -t Magento/backend
echo -en '\033[0;32mfrontend static created\033[0m \n'
echo -en '\033[0;32all static is update\033[0m \n'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment