evshiron / nwjs-builder

https://www.npmjs.com/package/nwjs-builder
76 stars 12 forks source link

Feature request: use templates in the "output directory" option #30

Closed charlielee closed 8 years ago

charlielee commented 8 years ago

It would be great if templates could be used in the "output directory" option in a similar manner to the "output name" field.

evshiron commented 8 years ago

Looks reasonable.

evshiron commented 8 years ago

@BoatsAreRockable Could you please give me some examples of your expectation for this feature?

charlielee commented 8 years ago

I'd like to be able to have an output directory name corresponding to the version field of my application's package.json, eg: AppName-{{version}}.

If you think this feature would have a limited usage then never mind, it should be easy enough for me to add a line to rename the output directory to add the version number in my build process :)

By the way, thanks for working on this project! I am very impressed at how quickly it has surpassed nw-builder in features.

evshiron commented 8 years ago

@BoatsAreRockable The output directory is where to put the builds, and I think the usage is quite limited. For your case, I have searched a bit and found some JSON command line tools, such as trentm/json. So a possible solution will be:

npm install json -g
nwb nwbuild -o "./$(json name < package.json)-$(json version < package.json)/" 

It should also work as module, simply read package.json and construct a string for outputDir should be enough.

Thank you. I am glad to know this project helps.

charlielee commented 8 years ago

Thank you for your help!