Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "print" command to print a templates value to stdout #17

Merged
merged 1 commit into from
Dec 27, 2015

Conversation

cdorrat
Copy link

@cdorrat cdorrat commented Dec 26, 2015

I've added a simple additional command "print" that accepts one or more templates on the command line and prints the value. It's useful for build scripts and allows you to keep templated files and other artefacts in sync.

For example to move a docker latest to to the last build in bash you could use:

PRJ_NAME=$(lein resource print "{{name}}")
PRJ_VERSION=$(lein resource print "{{version}}")
docker tag -f "${PRJ_NAME}:${PRJ_VERSION}" "${PRJ_NAME}:latest"

m0smith added a commit that referenced this pull request Dec 27, 2015
Added "print" command to print a templates value to stdout.  This is a great addition to the project.  It even supports doing something like 
    `lein resource print "user={{user.name.prop}} license={{license.name}}"`
@m0smith m0smith merged commit e00f0d6 into m0smith:master Dec 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants