From cb00d27abc1f442e7f5eb6223b8b5c31dacb115d Mon Sep 17 00:00:00 2001 From: Ryan Stelly Date: Wed, 12 Oct 2016 13:40:04 -0500 Subject: [PATCH] Add pre and post install script calls (#800) * fix tgz glob for powershell build (echo #729 fix) * add pre and post install script calls, and wrap prepub in ifdev --- src/cli/commands/install.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/install.js b/src/cli/commands/install.js index ea02ec8c63..9bdfa6df91 100644 --- a/src/cli/commands/install.js +++ b/src/cli/commands/install.js @@ -736,9 +736,15 @@ export async function run( throw new MessageError(reporter.lang('installCommandRenamed', `yarn ${command} ${exampleArgs.join(' ')}`)); } + await executeLifecycleScript(config, 'preinstall'); + const install = new Install(flags, config, reporter, lockfile); await install.init(); // npm behaviour, seems kinda funky but yay compatibility - await executeLifecycleScript(config, 'prepublish'); + await executeLifecycleScript(config, 'install'); + await executeLifecycleScript(config, 'postinstall'); + if (!flags.production) { + await executeLifecycleScript(config, 'prepublish'); + } }