Skip to content

A simple bash script that will purge all Magento 2 static content, generated classes and flush the cache.

License

Notifications You must be signed in to change notification settings

BenButterfield/m2purge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

M2Purge - a simple purge tool for Magento 2 developers

There's nothing more annoying than making a change on Magento 2, flushing the cache, and then not seeing your change reflected. This super simple tool provides an easy way for you to purge Magento 2 in a safe, quick and convenient way.

This script empties the following Magento 2 directories:

pub/static/*
generated/*
var/cache/*
var/di
var/composer_home/*
var/generation/*
var/page_cache/*
var/view_preprocessed/*

And then flushes the cache using the built in Magento 2 CLI:

bin/magento cache:flush

Installation

1. Download the latest version of the script

It doesn't really matter where you are in your filesystem, as we will move the script to it's new home in step 3.

wget https://raw.githubusercontent.com/BenButterfield/m2purge/master/m2purge.sh

2. Make the script executable (requires sudo rights)

This allows a user to execute the script in an SSH terminal.

sudo chmod +x m2purge.sh

3. Make the script available to all users (requires sudo rights)

By moving the script here and changing the name, you allow it to be run from anywhere in your filesystem using shorthand.

sudo mv m2purge.sh /usr/local/bin/m2p

Usage

Navigate to your Magento 2 root directory and then run:

m2p

About

A simple bash script that will purge all Magento 2 static content, generated classes and flush the cache.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages