Comments (13)
Looks like you have a typo in your version
script. As long as there is changelog.hbs
in the templates
directory, this should work:
"version": "auto-changelog -p -t templates/changelog.hbs"
Note templates
and not .templates
from auto-changelog.
@cookpete I had intended for it to be a hidden folder. Is there no support for such a capability?
from auto-changelog.
Ah I see. There's no reason why it wouldn't work in a hidden folder. The library just runs pathExists
on the -t
option and uses that template if there's a file there.
I noticed in your error it says changelog-template.hbs
was not found, but that's not the name of the file you passed in for the example above it. Are you sure -t
is pointing to a file that exists?
from auto-changelog.
@cookpete yes, certainly. I had added the file to the folder and on Windows, it was unable to find the file. not sure about unix. I had opted to remove the '-template' portion, but it wouldnt work either way when ran from cli and from npm scripts
from auto-changelog.
Not sure if it's related, but I did notice that the --template
flag is ignored if one is defined in package.json
. Was going to open an issue around that, but thought that might be the problem here...
from auto-changelog.
@gazzwi86 I've tried to reproduce the problem in 1995b29 using the exact same template path you were using, but the fake version commit after these changes is using the template correctly: 42deb8e
@jeffkpayne you are correct that the package options override the command line options currently, which is a bit backwards. This is due to the fact that commander
handles the command line options as well as applying the default options, so doing it the other way round would override the package options with the defaults. This could be better.
from auto-changelog.
@cookpete very strange. I shall take another look at my implementation, and see why might be happening.
from auto-changelog.
@cookpete no luck. Logs below - node version is v8.9.2, npm v5.5.1
➜ udf-core git:(development) ✗ npm run version
> [email protected] version /Users/a8604437/Sites/udf-core
> auto-changelog -p -t .templates/changelog.hbs && git add CHANGELOG.md
Error: Template 'changelog-template.hbs' was not found
at _callee$ (/Users/a8604437/Sites/udf-core/node_modules/auto-changelog/lib/template.js:39:19)
at tryCatch (/Users/a8604437/Sites/udf-core/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/Users/a8604437/Sites/udf-core/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (/Users/a8604437/Sites/udf-core/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/a8604437/Sites/udf-core/node_modules/auto-changelog/lib/template.js:107:191)
at /Users/a8604437/Sites/udf-core/node_modules/auto-changelog/lib/template.js:107:361
at <anonymous>
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] version: `auto-changelog -p -t .templates/changelog.hbs && git add CHANGELOG.md`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] version script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/a8604437/.npm/_logs/2017-12-08T13_36_49_307Z-debug.log
➜ udf-core git:(development) ✗ cat .templates/changelog.hbs
# Changelog
All notable changes to this `cwa-core` will be documented in this file.
{{#each releases}}
# [{{title}}[({{href}}) - {{niceDate}}
{{#each commits}}
- [{{subject}}]({{href}})
{{/each}}
{{/each}}
➜ udf-core git:(development) ✗
from auto-changelog.
@gazzwi86 I'm really confused as to why the error says changelog-template.hbs
can't be found when you are passing in .templates/changelog.hbs
as the template. Where is changelog-template.hbs
coming from?
from auto-changelog.
The line of code that spits out this error is outputting the template
option exactly as it was passed in. If the error is Template 'changelog-template.hbs' was not found
, then the script thinks the template option passed in is changelog-template.hbs
, and can't find it.
$ auto-changelog
9121 bytes written to CHANGELOG.md
$ auto-changelog -t changelog-template.hbs
Error: Template 'changelog-template.hbs' was not found
at _callee$ (C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\lib\template.js:39:19)
at tryCatch (C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\node_modules\regenerator-runtime\runtime.js:65:40)
at Generator.invoke [as _invoke] (C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\node_modules\regenerator-runtime\runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\lib\template.js:107:191)
at C:\Program Files (x86)\Nodist\bin\node_modules\auto-changelog\lib\template.js:107:361
at <anonymous>
$ echo "Test" > changelog-template.hbs
$ auto-changelog -t changelog-template.hbs
9 bytes written to CHANGELOG.md
from auto-changelog.
Also @gazzwi86 take heed of Jeff's comment above – do you have "template": "changelog-template.hbs"
in your package.json
by chance?
from auto-changelog.
Sorry! It was me being stupid. I hadn't realised the package.json
config was in control her. I thought the command would take precedence.
Sorry to trouble you
from auto-changelog.
Sorry! It was me being stupid. I hadn't realised the package.json config was in control her. I thought the command would take precedence.
I think the command should take precedence, so I'll look into fixing that.
from auto-changelog.
Related Issues (20)
- [Feature Request] Show contributors in changelog
- Feature: Add an option to allow indention HOT 4
- Bug(?) No summary output HOT 1
- Feature: Add `starting-ref` and `ending-ref` option HOT 2
- Filtering back-merges and dev to main merges
- Test of releases are failing
- Support GitLab's new style routes HOT 5
- --commit-pattern option mentioned in readme doesnt exist HOT 2
- Support `--package pyproject.toml`
- Deduplicate Issues in output
- SyntaxError: Unexpected token v in JSON at position 478
- Only getting the last commit on "CHANGELOG.md" HOT 4
- Latest version on the changelog is not respecting tagPrefix HOT 1
- Questions on workflow
- Question about filtering in templates HOT 3
- Only the last tags HOT 1
- Feature Request: Debug HOT 4
- replaceText only applies to subject and not message
- `--starting-date` not working in 2024 HOT 1
- Getting undefined in generated file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-changelog.