Skip Navigation

bmakelib v0.6.0 with enums

github.com

Release v0.6.0 Β· bahmanm/bmakelib

bmakelib is a collection of useful targets, recipes and variables you can use to augment your Makefiles.


I just released bmakelib v0.6.0 w/ the main highlight being the ability to define enums and validate variable values against them.


➀ Makefile:

 Makefile
    
define-enum : bmakelib.enum.define( DEPLOY-ENV/dev,staging,prod )
include define-enum

deploy : bmakelib.enum.error-unless-member( DEPLOY-ENV,ENV )
deploy :
    @echo πŸš€ Deploying to $(ENV)...

  

➀ Shell:

 text
    
$ make ENV=local-laptop deploy
*** 'local-laptop' is not a member of enum 'DEPLOY-ENV'.  Stop.

$ make ENV=prod deploy
πŸš€ Deploying to prod...

  
General Programming Discussion @lemmy.ml

bmakelib v0.6.0 with enums

0 comments

No comments