mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:07:08 +00:00
Do not error out of npm install if postinstall fails.
The postinstall script will (rightly) return non-zero if the API docs cannot be built, but this creates a problem when building a container (Docker) image. In that case, we expect the postinstall to fail, as the required files (spec/*) will not have been copied into the image when `npm install` is run. By adding an explicit OR clause we allow postinstall to end gracefully whether or not the API docs have been built.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"postinstall": "[[ -e ./node_modules/DOUGAL_ROOT ]] || ln -s .. ./node_modules/DOUGAL_ROOT; redoc-cli bundle ./spec/openapi.yaml -o ./spec/openapi.html"
|
||||
"postinstall": "test -e node_modules/DOUGAL_ROOT || ln -s .. node_modules/DOUGAL_ROOT; test -e spec && test -e spec/openapi.yaml && node_modules/.bin/redoc-cli bundle ./spec/openapi.yaml -o ./spec/openapi.html || echo API documentation not present or failed to compile >/dev/stderr"
|
||||
},
|
||||
"author": "Aaltronav s.r.o.",
|
||||
"license": "UNLICENSED",
|
||||
|
||||
Reference in New Issue
Block a user