Konstantinos Pittas

CTO of Archmule

Handle Third-Party Dependencies

In shared projects, I usually forget how to pull packages added by others. If you use Composer, Bower, Yarn, Gulp or Laravel Mix, you may need this too.

Add the following line in your .bashrc or .zshrc:

alias installdeps="if [ -f ./package.json ]; then yarn ; fi && if [ -f ./bower.json ]; then bower install ; fi && if [ -f ./composer.json ]; then composer install ; fi && if [ -f ./gulpfile.js ]; then gulp ; fi && if [ -f ./webpack.mix.js ]; then yarn run dev ; fi"

If you also want to update the dependencies to their latest versions, use this alias:

alias updatedeps='if [ -f ./package.json ]; then yarn upgrade ; fi && if [ -f ./bower.json ]; then bower update ; fi && if [ -f ./composer.json ]; then composer update ; fi && if [ -f ./gulpfile.js ]; then gulp ; fi && if [ -f ./webpack.mix.js ]; then yarn run dev ; fi'
← Back home