wee initializer/util: gitcheck.js

7 views
Skip to first unread message

Mike Slattery

unread,
May 19, 2015, 9:03:35 PM5/19/15
to action...@googlegroups.com
Hey there,

I'm just posting a small thing that I'm finding useful, an initializer that sweeps my plugins, and reports what git branch actionhero is serving up..


This initializer checks plugin directories for git branches, and reports which branch is being loaded by the server.

I use `npm link` to serve up my plugins-in-progress for actionhero. I ask npm's preinstall hook to run `npm link $PLUGIN` so that the plugin will be in actionhero's node_modules dir.

It works well for us, but when the gitflow is feverish I need to double check which branch I'm running in a given actionhero config.

I put this initializer at the projectRoot level, and it sweeps my plugins to report on git branches.

2015-05-19 20:46:51 - notice: environment: singlebox
2015-05-19 20:46:51 - notice: Plugin ah-spa-plugin is serving git branch: ⎇  master
2015-05-19 20:46:51 - notice: Plugin ah-app-plugin is serving git branch: ⎇  feature/bumpah
2015-05-19 20:46:51 - notice: *** Server Started @ 2015-05-19 20:46:51 ***

Evan Tahler

unread,
May 20, 2015, 5:43:52 AM5/20/15
to action...@googlegroups.com, mike.s...@gmail.com
Neat! 
Reply all
Reply to author
Forward
0 new messages