Skip to content

Instantly share code, notes, and snippets.

@luizventurote
Last active August 29, 2019 17:46
Show Gist options
  • Save luizventurote/43af7ba2855748b899d19297f1786aa6 to your computer and use it in GitHub Desktop.
Save luizventurote/43af7ba2855748b899d19297f1786aa6 to your computer and use it in GitHub Desktop.
Bash script to deploy Magento 2 theme static content.
#!/usr/bin/env bash
echo "M2 - Deploy Static Content $1/$2 🚀"
rm -rf var/view_preprocessed/pub/static/frontend/$1/$2
rm -rf var/view_preprocessed/source/frontend/$1/$2
grunt exec:$2
grunt less:$2
grunt watch
echo "Done ⚡️"
@luizventurote
Copy link
Author

luizventurote commented May 9, 2018

Set the right permissions before if necessary: chmod +x ./m2theme.sh.

@luizventurote
Copy link
Author

To run this script on any folder, do this on mac OS: sudo cp m2theme.sh /usr/local/bin.

@luizventurote
Copy link
Author

luizventurote commented Nov 11, 2018

How to use: m2theme.sh Package theme_name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment