Assalamualaikum / Hi,
I’ve been working on software development for about 10 years plus, and day by day I try to be more productive, speed up daily tasks.
Today, will share some of the practices I’ve simplified using bash scripts.
Usually on new clone / project, I need to initialise my application – run migrate, generate key, etc.
Following are my bash codes use for initialising my application – with 2 conditions: you already created your database and update your
Once you are done setting up above script in
bin/ directory, then you can run
bin/init.sh when you are done cloning and create the database for the your application.
PSR-2: Coding Style Guide
I always want consistency in my coding style, even across team members. Using PHP CS Fixer is a big help for me. I have my own preference for the code style – I prefer clarity, readability. You can see the details here.
For CS Fixer, I’ve created a bash script as well:
Much simpler with just calling
bin/csfix.sh. Of course, some enhancement to check if there’s changes, only then commit. Contribution much appreciated.
Clearing caches, sometimes can be headache. As mentioned previously, I already have the
reload:cache command. But in this bash script, just adding 2 lines of code other than
Lastly, updating dependencies with single command is useful.
Signal for Improvement
Based on my experiences and observations, one way to find out what can be improvise and automate is the one that you been use it over and over again. If you have those practices, scenarios – that’s a signal of improvement of your workflow. Do simplify and automate it as much as possible.
I believe, I still have lot of area to improve in my development workflow.
Do share with me if you have any. Looking forward new knowledges, practices. You can contact me via Telegram.
Another area to explore is Composer Scripts.