MCPcopy Index your code
hub / github.com/bower/bower / hook

Function hook

lib/core/scripts.js:86–113  ·  view source on GitHub ↗
(
    action,
    ordered,
    config,
    logger,
    packages,
    installed,
    json
)

Source from the content-addressed store, hash-verified

84};
85
86var hook = function(
87 action,
88 ordered,
89 config,
90 logger,
91 packages,
92 installed,
93 json
94) {
95 if (
96 mout.object.keys(packages).length === 0 ||
97 !config.scripts ||
98 !config.scripts[action]
99 ) {
100 return Q();
101 }
102
103 var orderedPackages = ordered
104 ? orderByDependencies(packages, installed, json)
105 : mout.object.keys(packages);
106 var placeholder = new RegExp('%', 'g');
107 var cmdString = mout.string.replace(
108 config.scripts[action],
109 placeholder,
110 orderedPackages.join(' ')
111 );
112 return run(cmdString, action, logger, config);
113};
114
115module.exports = {
116 preuninstall: mout.function.partial(hook, 'preuninstall', false),

Callers

nothing calls this directly

Calls 2

orderByDependenciesFunction · 0.85
runFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…