Delete firebug console calls before posting on produciton

    Foreword

    Recently, there have been few posts related to web development. I hope my post will look advantageous due to the contrast :)

    The article itself:


    One of these days it was necessary to go to show the representative of the customer how to use one feature freshly built into the project.

    Half an hour before the release, I prepared a new build and tested it.

    Upon arrival, it turned out that the feature does not work for the customer. It turned out unpleasantly, in general.

    It turned out that I forgot to delete the call of the firebug console in the event handler function ( console.log... etc.). It often happens to me that I’m either typing a character by accidentally clicking on the keyboard, or, on the contrary, I’ll delete - in short, the use of editors without syntax highlighting and (preferably) analysis of the code structure is contraindicated to me.

    Since I use apache ant to deploy the application to the combat server, I added a little script that removes all calls console.log(/* something */)orconsole.dir(/* something */)from your code.

    Actually, here it is:

    1.     
    2.     
    3.  
    4.     
    5.         github.com/yui/builder/blob/master/componentbuild/shared/properties.xml 79-я строка -->
    6.     
    7.     
    8.     
    9.     
    10.     
    11.     
    12.         github.com/yui/builder/blob/master/componentbuild/3.x/module.xml 19-я строка -->
    13.     
    14.         
    15.                       match="${firebug.console.regex}"
    16.                       replace="${firebug.console.regex.replace}"
    17.                       flags="${firebug.console.regex.flags}">
    18.             
    19.         
    20.     
    * This source code was highlighted with Source Code Highlighter.

    Use this way: create an xml file with a name that is convenient for you (for example, boom.xml) and copy this code into it. Of course, it is worth adjusting the value of the js variable, which points to a folder with js scripts not yet compressed. After that, we start the infernal machine with this command (for bash):

    ant stripFirebugConsoleCalls -buildfile /path/to/boom.xml

    That's all. Then I take off until the next state of emergency or the end of the project.

    Also popular now: