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

Poveden/parse error message #18

Merged
merged 3 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [1.1.4](https://github.com/axa-group/arm-template-merge/compare/v1.1.3...v1.1.4) — 2019-10-10

### Security

- Update `npm` dependencies to fix:
- [WS-2019-0291](https://github.com/wycats/handlebars.js/issues/1558)

### Added

- Improve error message on template parsing failures

## [1.1.3](https://github.com/axa-group/arm-template-merge/compare/v1.1.2...v1.1.3) — 2019-09-25

### Security
Expand Down
8 changes: 7 additions & 1 deletion bin/arm-template-merge
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ async function loadTemplate(inFile) {
}

const json = jsonBuf.toString('utf8');
const template = JSON.parse(json);

let template;
try {
template = JSON.parse(json);
} catch (err) {
throw new Error(`Template '${inFile}' could not be parsed: ${err.message}`);
}

const expectedKeys = ['$schema', 'contentVersion'];

Expand Down
80 changes: 35 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arm-template-merge",
"version": "1.1.3",
"version": "1.1.4",
"description": "Azure Resource Manager (ARM) Template Merge",
"keywords": [
"azure",
Expand Down Expand Up @@ -41,10 +41,10 @@
"test": "npm run jest"
},
"dependencies": {
"fast-glob": "^3.0.4"
"fast-glob": "^3.1.0"
},
"devDependencies": {
"eslint": "^6.4.0",
"eslint": "^6.5.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.17.0",
Expand Down
2 changes: 1 addition & 1 deletion test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('CLI', () => {
rfn.mockRestore();

expect(res.exitCode).toBe(1);
expect(res.stderr).toMatch(/^Error:/);
expect(res.stderr).toMatch(/^Error: Template 'templates\/website.json' could not be parsed:/);
});

it('should be able to merge template files into a new file', async () => {
Expand Down