Created
October 22, 2018 12:50
-
-
Save vguardiola/8901527a4949299661c7416c60eb7896 to your computer and use it in GitHub Desktop.
Add namespaces php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for i in `grep -L 'namespace ' *.php`; | |
| do | |
| path=`pwd` | |
| namespace=${path//\//\\\\}; | |
| namespace=${namespace:1}; | |
| echo "change file ${i}"; | |
| sed -i "2i\ | |
| namespace $namespace\ | |
| " ${i} | |
| done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment