Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a standalone, portable command line implementation of Mustache for windows?

Tags:

mustache

Is there a simple, standalone, portable, existing distribution of Mustache for windows that lets me invoke Mustache exactly as specified (or as close as possible) in the mustache(1) manual?

cat data.yml template.mustache | mustache

I can't find any explanation of how to actually acquire an executable called mustache to use mustache in this way - on any platform, although I'm primarily interested in Windows right now.

As far as I can tell, the various implementations of mustache listed on the mustache homepage are mostly libraries, rather than standalone applications that can be invoked in this way.

Ideally, I'm looking for something that's:

  • Standalone - I am looking for something I can invoke from the command line, not a library. I am planning to generate output as part of my automated CI build.
  • Portable - I should be able to bundle everything I need into source control, without having to preinstall anything (since my build may run on one of many build agents, I do not wish to maintain a suite of preinstalled software on multiple agents); nor can I connect to the internet to download libraries. Ideally the portable packaging should be fairly straightforward to bundle.

If this isn't available then I'm interested in getting as close as possible - e.g. if I have to preinstall python but not needing to run an installer which connects to the internet.

I'm prepared to concede on the "no preinstall" if it's something I have a cat in hell's chance of already having packaged up at our organisation (e.g. python or ruby) but not for individual libraries.

like image 873
bacar Avatar asked Feb 07 '14 10:02

bacar


2 Answers

From the docs:

INSTALLATION

If you have RubyGems installed:

gem install mustache

See https://mustache.github.io/mustache.1.html bottom of page

like image 183
glenn Avatar answered Oct 06 '22 00:10

glenn


I think you could use one of the implementations of Mustache that compiles to a native executable. For instance, here are the pre-compiled releases for the Go client.

Thus installing to a Linux server could look something like:

GO_MUSTACHE_VERSION=1.2.0
curl -s -L -o /tmp/mustache.tgz https://github.com/cbroglie/mustache/releases/download/v${GO_MUSTACHE_VERSION}/mustache_${GO_MUSTACHE_VERSION}_linux_amd64.tar.gz
tar xvf /tmp/mustache.tgz -C path/to/installation
like image 41
John Avatar answered Oct 06 '22 00:10

John