Skip to content

Commit

Permalink
Error should exit script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Templarian committed Aug 6, 2019
1 parent 27626ea commit 70149b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,17 @@ if (argv.svg !== './svg') {

if (!fs.existsSync(fontBuildFile)) {
console.error(`Unable to find "${fontBuildFile}". Use --help to learn more.`);
process.exit(1);
}

if (!fs.existsSync(metaFile)) {
console.error(`Unable to find "${metaFile}". Use --help to learn more.`);
process.exit(1);
}

if (!fs.existsSync(svgFolder)) {
console.error(`Unable to find "${svgFolder}" folder. Use --help to learn more.`);
process.exit(1);
}

const fontBuildString = fs.readFileSync(fontBuildFile);
Expand Down Expand Up @@ -96,6 +99,7 @@ if (errors.length) {
console.error(error);
});
console.error('etc...');
process.exit(1);
}

function generateFolders() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mdi/font-build",
"version": "1.1.0",
"version": "1.2.0",
"description": "Material Design Icons webfont builder.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 70149b4

Please sign in to comment.