MCPcopy
hub / github.com/triggerdotdev/trigger.dev / hasUserConfirmed

Function hasUserConfirmed

packages/cli/src/commands/update.ts:118–141  ·  view source on GitHub ↗
(
  packagesToUpdate: string[],
  packageMaps: { [x: string]: { type: string; version: string } },
  updatedDependencies: { [x: string]: any }
)

Source from the content-addressed store, hash-verified

116}
117
118async function hasUserConfirmed(
119 packagesToUpdate: string[],
120 packageMaps: { [x: string]: { type: string; version: string } },
121 updatedDependencies: { [x: string]: any }
122): Promise<boolean> {
123 // Inform the user of the dependencies that can be updated
124 console.log("\nNewer versions found for the following packages:");
125 console.table(
126 packagesToUpdate.map((i) => ({
127 name: i,
128 old: packageMaps[i]?.version,
129 new: updatedDependencies[i],
130 }))
131 );
132
133 // Ask the user if they want to update the dependencies
134 const { confirm } = await inquirer.prompt({
135 type: "confirm",
136 name: "confirm",
137 message: "Do you want to update these packages in package.json and re-install dependencies?",
138 });
139
140 return confirm;
141}

Callers 1

updateCommandFunction · 0.85

Calls 2

logMethod · 0.65
tableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…