Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c0fcb4a

Browse files
committedSep 20, 2019
Build: Stop release if issues are find during deployment
Fix #717
1 parent ff08781 commit c0fcb4a

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed
 

‎helpers/postinstall.js

+22-18
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@
22
* Post Install Script
33
* Copies a set of files from the `@hint/artwork` asset repository into this one
44
*/
5-
const shell = require('shelljs');
6-
const mkdirp = require('mkdirp');
5+
try {
6+
const shell = require('shelljs');
7+
const mkdirp = require('mkdirp');
78

8-
const baseSrcPath = 'node_modules/@hint/artwork/src/';
9-
const baseTargetPath = 'src/webhint-theme/source/images/';
9+
const baseSrcPath = 'node_modules/@hint/artwork/src/';
10+
const baseTargetPath = 'src/webhint-theme/source/images/';
1011

11-
const fileSrcAndTargets = {
12-
'other/confused/confused.svg': 'nellie-confused.svg',
13-
'other/developing/developing.svg': 'developer-nellie.svg',
14-
'other/octocat/octocat_1.svg': 'nellie-octocat.svg',
15-
'other/searching/searching.svg': 'nellie-searching.svg',
16-
'other/sunglasses/sunglasses.svg': 'nellie-customizable.svg',
17-
'other/working/working.svg': 'nellie-construction.svg'
18-
};
12+
const fileSrcAndTargets = {
13+
'other/confused/confused.svg': 'nellie-confused.svg',
14+
'other/developing/developing.svg': 'developer-nellie.svg',
15+
'other/octocat/octocat_1.svg': 'nellie-octocat.svg',
16+
'other/searching/searching.svg': 'nellie-searching.svg',
17+
'other/sunglasses/sunglasses.svg': 'nellie-customizable.svg',
18+
'other/working/working.svg': 'nellie-construction.svg'
19+
};
1920

20-
mkdirp.sync(baseTargetPath);
21+
mkdirp.sync(baseTargetPath);
2122

22-
Object.entries(fileSrcAndTargets).forEach((entry) => {
23-
const srcPath = entry[0];
24-
const targetPath = entry[1];
23+
Object.entries(fileSrcAndTargets).forEach((entry) => {
24+
const srcPath = entry[0];
25+
const targetPath = entry[1];
2526

26-
shell.cp(`${baseSrcPath}${srcPath}`, `${baseTargetPath}${targetPath}`);
27-
});
27+
shell.cp(`${baseSrcPath}${srcPath}`, `${baseTargetPath}${targetPath}`);
28+
});
29+
} catch (e) {
30+
console.log(`Couldn't copy images, probably install in "--production" mode`);
31+
}

‎package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
"globby": "^10.0.1",
99
"highlight.js": "^9.15.10",
1010
"js-yaml": "^3.13.1",
11-
"klaw": "^3.0.0",
1211
"lodash": "^4.17.15",
13-
"mkdirp": "^0.5.1",
1412
"moment": "^2.24.0",
1513
"request": "^2.88.0",
16-
"shelljs": "^0.8.3",
1714
"strip-indent": "^3.0.0",
1815
"xss-filters": "^1.2.7"
1916
},
@@ -56,10 +53,12 @@
5653
"markdownlint-cli": "^0.18.0",
5754
"marked": "^0.7.0",
5855
"md-2-json": "^1.0.6",
56+
"mkdirp": "^0.5.1",
5957
"mktemp": "^1.0.0",
6058
"normalize-path": "^3.0.0",
6159
"npm-run-all": "^4.1.3",
6260
"remove-markdown": "^0.3.0",
61+
"shelljs": "^0.8.3",
6362
"stylelint": "^11.0.0",
6463
"sw-precache": "^5.2.1",
6564
"typescript": "^3.6.3",

0 commit comments

Comments
 (0)
Please sign in to comment.