Merge pre-install scripts
This commit is contained in:
parent
525d41e63c
commit
dcf765efda
@ -78,7 +78,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"",
|
"lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"",
|
||||||
"lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"",
|
"lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"",
|
||||||
"preinstall": "./scripts/darwin-pre-install.sh",
|
"preinstall": "scripts/darwin-pre-install.sh",
|
||||||
"pretest:setup": "npm run lint",
|
"pretest:setup": "npm run lint",
|
||||||
"test:setup": "NODE_ENV=test node test setup",
|
"test:setup": "NODE_ENV=test node test setup",
|
||||||
"pretest": "npm run test:setup",
|
"pretest": "npm run test:setup",
|
||||||
|
25
scripts/darwin-pre-install.sh
Executable file
25
scripts/darwin-pre-install.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
|
||||||
|
CAIRO_PKG_CONFIG=`pkg-config cairo --cflags-only-I 2> /dev/null`
|
||||||
|
RESULT=$?
|
||||||
|
|
||||||
|
if [[ ${RESULT} -ne 0 ]]; then
|
||||||
|
echo "###################################################################################"
|
||||||
|
echo "# PREINSTALL HOOK ERROR #"
|
||||||
|
echo "#---------------------------------------------------------------------------------#"
|
||||||
|
echo "# #"
|
||||||
|
echo "# node-canvas install error: some packages required by 'cairo' are not found #"
|
||||||
|
echo "# #"
|
||||||
|
echo -e "# Use '\033[1mmake all\033[0m', it will take care of common/known issues #"
|
||||||
|
echo "# #"
|
||||||
|
echo "# As an alternative try: #"
|
||||||
|
echo "# Try to 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig' #"
|
||||||
|
echo "# #"
|
||||||
|
echo "# If problems persist visit: https://github.com/Automattic/node-canvas/wiki #"
|
||||||
|
echo "# #"
|
||||||
|
echo "###################################################################################"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user