Skip to content

Commit

Permalink
Add pre and post install script calls (#800)
Browse files Browse the repository at this point in the history
* fix tgz glob for powershell build (echo #729 fix)

* add pre and post install script calls, and wrap prepub in ifdev
  • Loading branch information
FLGMwt authored and Sebastian McKenzie committed Oct 12, 2016
1 parent eea92a3 commit cb00d27
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cli/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit cb00d27

Please sign in to comment.