Is it possible to use a template from the command line?

Since there are no fodler templates, I have created a simple batch file to copy files from a "seed" folder and name them appropriately.  The next step would be to actually utilize my existing file templates.  Is this possible?

Comment actions Permalink

Hi there,

Please clarify your requirements / what you want to do.

Comment actions Permalink

Well I've created a batch file that creates a folder structure for my Polymer elements.

@echo off
set seed=seed-element
set target=%1
@echo Creating new element named "%target%"
echo Creating Folder...
md %target%
echo copying seed files from %seed%...
copy %seed%\%seed%.html %target%\%target%.html >nul
copy %seed%\%seed%.less %target%\%target%.less >nul
copy %seed%\demo.html %target%\demo.html >nul
copy %seed%\index.html %target%\index.html >nul
copy %seed%\ %target%\ >nul
copy %seed%\bower.json %target%\bower.json >nul
copy %seed%\tests %target%\tests >nul
echo Done!

It would be awesome if I could replace some of the copy commands with something like "template polymer %target%.html" which would be like right-clicking and selecting "New > Polymer" which executes the following template I have created:

<link rel="import" href="../polymer/polymer.html">

<polymer-element name="${NAME}" noscript>
        <link href="${NAME}.css" rel="stylesheet">
        <!--HTML Goes here-->

I hope this makes sense.

Basically, instead of right-clicking and selecting new > template, I want to be able to do it from a command.

Comment actions Permalink

That is not currently possible. Check tickets in that another thread:

I may only suggest to implement something like that via Phing or alike (Phing has enough built-in tasks that can handle file copying as well as file modifications based on certain patterns).


Please sign in to leave a comment.