Skip to content

Commit

Permalink
refactored logic
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
amsiglan committed Apr 11, 2024
1 parent 53de994 commit cb7a079
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"build": "yarn plugin-helpers build",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"postbuild": "echo Renaming build artifact to [$npm_package_config_id-$npm_package_version.zip] && mv build/$npm_package_config_id*.zip build/$npm_package_config_id-$npm_package_version.zip",
"run:postinstall": "pwd && node ../../../scripts/postinstall_alerting",
"postinstall": "yarn run:postinstall"
"postinstall": "node ./scripts/postinstall_alerting"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.22.9",
Expand Down
12 changes: 7 additions & 5 deletions scripts/postinstall_alerting.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

const { exec } = require('child_process');
const { exec, execSync } = require('child_process');

function run() {
exec('husky install', (_error) => {});
}
const { INIT_CWD, PWD = process.cwd() } = process.env;

run();
if (INIT_CWD?.startsWith?.(PWD)) {
try {
execSync('husky install');
} catch (error) {}
}

0 comments on commit cb7a079

Please sign in to comment.