cancel
Showing results for 
Search instead for 
Did you mean: 

command line option to clear static assets

command line option to clear static assets

Feature request from markoshust, posted on GitHub Sep 07, 2015

There is a flag on the ./bin/magento module:enable command: --clear-static-content

Unfortunately, this only appears to be on the module-enable option. If static assets are desired to be cleared at any other time, this isn't an option.

I believe there should be a new command under ./bin/magento that just clears this static content, something like: ./bin/magento cache:clear-static-content

I'm not sure if static assets are considered a cached asset, so this may need some revision.

Thanks! Mark

6 Comments
New Member
Status changed to: Investigating
 
New Member

Comment from xcomSteveJohnson, posted on GitHub Sep 07, 2015

Fair point. There is one other time that static view files are cleared: switching from developer <> production modes.

http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html

New Member

Comment from godban, posted on GitHub Sep 08, 2015

@markoshust there is grunt clean, maybe would be helpful

New Member

Comment from alankent, posted on GitHub Sep 08, 2015

We need this separation potentially for automated deployment pipelines. Grunt might be a short term workaround, but must not be mandatory for that (e.g. switching from dev to prod mode). We should have a separate magento command if its needed. We have been introducing these CLI commands to avoid "oh, for use case X remove directory Y" - we want it to be "for use case X run command Y" so if we change things internally related to "use case X", we can adjust "command Y" to follow the new rules without breaking existing deployment pipelines.

New Member

Comment from Desmaster, posted on GitHub May 02, 2016

Really missing this feature as well, people shouldn't be removing directories when deploying.. Thinking about creating my own pull request to get it on the rails asap.

New Member

Comment from mbrinton01, posted on GitHub Aug 18, 2016

Created internal issue MAGETWO-57193 to track this suggestion