Skip to content

Commit 85b5725

Browse files
author
hknokh2
committed
fix: guard husky postinstall for sf plugin install without dev dependencies
- changed package.json postinstall to skip husky when npm omit includes dev - changed postinstall behavior to skip without .git and with SFDMU_SKIP_HUSKY=1 - fixed sf plugins install failure caused by missing husky in omit-dev environment - validated package change with lint, test, and compile commands
1 parent a6bde08 commit 85b5725

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"lint": "wireit",
9797
"addon": "node ./scripts/addon.js",
9898
"addon:compile": "wireit",
99-
"postinstall": "yarn husky install",
99+
"postinstall": "node -e \"const fs=require('fs');const cp=require('child_process');const omit=String(process.env.npm_config_omit||'').split(',').map(s=>s.trim()).filter(Boolean);const devOmitted=omit.includes('dev')||process.env.npm_config_production==='true';if(devOmitted||process.env.SFDMU_SKIP_HUSKY==='1'||!fs.existsSync('.git')){process.exit(0);}try{cp.execSync('husky install',{stdio:'inherit',shell:true});}catch{process.exit(0);}\"",
100100
"postpack": "sf-clean --ignore-signing-artifacts",
101101
"prepack": "sf-prepack",
102102
"test": "wireit",

0 commit comments

Comments
 (0)