Skip to content

Commit d62bf11

Browse files
committed
Fix postinstall issues
### FIXED - When manually installing package globally, `postinstall` script would run without `devDependencies` properly installed.
1 parent 55e4e5b commit d62bf11

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "homebridge-adt-pulse",
33
"displayName": "Homebridge ADT Pulse",
4-
"version": "3.4.12",
4+
"version": "3.4.13",
55
"description": "Homebridge security system platform for ADT Pulse",
66
"main": "./build/index.js",
77
"exports": "./build/index.js",

postinstall.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { execSync } from 'node:child_process';
22

3-
if (process.env.npm_config_omit !== 'dev') {
3+
const isGlobal = process.env.npm_config_global === 'true';
4+
const isDevOmitted = process.env.npm_config_omit === 'dev';
5+
6+
if (!isGlobal && !isDevOmitted) {
47
console.info('Running post-install commands ...');
58

69
execSync('npm run build', {

0 commit comments

Comments
 (0)