GithubHelp home page GithubHelp logo

benbutterfield / m2purge Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 17 KB

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

License: GNU General Public License v3.0

Shell 100.00%

m2purge's Introduction

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

m2purge's People

Contributors

benbutterfield avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.