Open benjaminbojko opened 9 years ago
Allows for a custom filter function to run string operations on the DB dump before importing it to each environment.
For example, this allows for custom fixes regarding MySQL warnings as discussed in #6, #37 and #34 by adding the following filter:
local: { 'title': 'local', //... 'filter': function(mysql_dump) { return mysql_dump.replace(/^Warning.*\n?/gm, ''); // filter MySQL warnings } }
I've also used it to switch between wordpress themes when pushing/pulling from/to local:
local: { 'title': 'local', //... 'filter': function(mysql_dump) { return mysql_dump .replace(/^Warning.*\n?/gm, '') // filter MySQL warnings .replace(/'(current_theme)','My Production Theme'/g, '\'$1\',\'My Development Theme\'') .replace(/'(stylesheet|template)','my-production-theme-folder'/g, '\'$1\',\'my-dev-theme-folder\''); } } //... staging: { 'title': 'staging', //... 'filter': function(mysql_dump) { return mysql_dump .replace(/^Warning.*\n?/gm, '') // filter MySQL warnings .replace(/'(current_theme)','My Development Theme'/g, '\'$1\',\'My Production Theme\'') .replace(/'(stylesheet|template)','my-dev-theme-folder'/g, '\'$1\',\'my-production-theme-folder\''); } }
Allows for a custom filter function to run string operations on the DB dump before importing it to each environment.
For example, this allows for custom fixes regarding MySQL warnings as discussed in #6, #37 and #34 by adding the following filter:
I've also used it to switch between wordpress themes when pushing/pulling from/to local: