MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / installPackage

Function installPackage

packages/bumpy/src/commands/init.ts:199–209  ·  view source on GitHub ↗
(pm: string, pkgName: string, rootDir: string)

Source from the content-addressed store, hash-verified

197}
198
199async function installPackage(pm: string, pkgName: string, rootDir: string): Promise<void> {
200 const cmd = `${PM_ADD_DEV[pm] || 'npm install -D'} ${pkgName}`;
201 log.step(`Installing ${pkgName}...`);
202 try {
203 run(cmd, { cwd: rootDir });
204 log.dim(` ${cmd}`);
205 } catch (err) {
206 log.warn(`Failed to install ${pkgName}: ${err instanceof Error ? err.message : err}`);
207 log.dim(` Run manually: ${cmd}`);
208 }
209}
210
211async function uninstallPackage(pm: string, pkgName: string, rootDir: string): Promise<void> {
212 const cmd = `${PM_REMOVE[pm] || 'npm uninstall'} ${pkgName}`;

Callers 1

initCommandFunction · 0.85

Calls 1

runFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…