@@ -43,7 +43,7 @@ export function configureUpdateCommand(program: Command) {
4343const triggerPackageFilter = / ^ @ t r i g g e r \. d e v / ;
4444
4545export async function updateCommand ( dir : string , options : UpdateCommandOptions ) {
46- await updateTriggerPackages ( dir , options ) ;
46+ await updateTriggerPackages ( dir , options , false ) ;
4747}
4848
4949export async function updateTriggerPackages (
@@ -127,24 +127,30 @@ export async function updateTriggerPackages(
127127
128128 if ( mismatches . length === 0 ) {
129129 if ( ! embedded ) {
130- outro ( `Nothing to do ${ newCliVersion ? " ..but you should really update your CLI!" : "" } ` ) ;
130+ outro ( `Nothing to update ${ newCliVersion ? " ..but you should really update your CLI!" : "" } ` ) ;
131131 return hasOutput ;
132132 }
133133 return hasOutput ;
134134 }
135135
136- if ( isDowngrade ) {
137- prettyError ( "Some of the installed @trigger.dev packages are newer than your CLI version" ) ;
138- } else {
139- prettyWarning (
140- "Mismatch between your CLI version and installed packages" ,
141- "We recommend pinned versions for guaranteed compatibility"
142- ) ;
136+ if ( embedded ) {
137+ if ( isDowngrade ) {
138+ prettyError ( "Some of the installed @trigger.dev packages are newer than your CLI version" ) ;
139+ } else {
140+ if ( embedded ) {
141+ prettyWarning (
142+ "Mismatch between your CLI version and installed packages" ,
143+ "We recommend pinned versions for guaranteed compatibility"
144+ ) ;
145+ }
146+ }
143147 }
144148
145149 if ( ! hasTTY ) {
146150 // Running in CI with version mismatch detected
147- outro ( "Deploy failed" ) ;
151+ if ( embedded ) {
152+ outro ( "Deploy failed" ) ;
153+ }
148154
149155 console . log (
150156 `ERROR: Version mismatch detected while running in CI. This won't end well. Aborting.
@@ -187,14 +193,20 @@ export async function updateTriggerPackages(
187193
188194 if ( ! userWantsToUpdate ) {
189195 if ( requireUpdate ) {
190- outro ( "You shall not pass!" ) ;
191-
192- logger . log (
193- `${ chalkError (
194- "X Error:"
195- ) } Update required: Version mismatches are a common source of bugs and errors. Please update or use \`--skip-update-check\` at your own risk.\n`
196- ) ;
197- process . exit ( 1 ) ;
196+ if ( embedded ) {
197+ outro ( "You shall not pass!" ) ;
198+
199+ logger . log (
200+ `${ chalkError (
201+ "X Error:"
202+ ) } Update required: Version mismatches are a common source of bugs and errors. Please update or use \`--skip-update-check\` at your own risk.\n`
203+ ) ;
204+ process . exit ( 1 ) ;
205+ } else {
206+ outro ( "No updates applied" ) ;
207+
208+ process . exit ( 0 ) ;
209+ }
198210 }
199211
200212 if ( ! embedded ) {
@@ -205,7 +217,7 @@ export async function updateTriggerPackages(
205217 }
206218
207219 const installSpinner = spinner ( ) ;
208- installSpinner . start ( "Writing new package.json file " ) ;
220+ installSpinner . start ( "Updating dependencies in package.json" ) ;
209221
210222 // Backup package.json
211223 const packageJsonBackupPath = `${ packageJsonPath } .bak` ;
@@ -235,12 +247,16 @@ export async function updateTriggerPackages(
235247 const packageManager = await detectPackageManager ( projectPath ) ;
236248
237249 try {
238- installSpinner . message ( `Installing new package versions with ${ packageManager } ` ) ;
250+ installSpinner . message (
251+ `Installing new package versions${ packageManager ? ` with ${ packageManager . name } ` : "" } `
252+ ) ;
239253
240- await installDependencies ( { cwd : projectPath } ) ;
254+ await installDependencies ( { cwd : projectPath , silent : true } ) ;
241255 } catch ( error ) {
242256 installSpinner . stop (
243- `Failed to install new package versions${ packageManager ? ` with ${ packageManager } ` : "" } `
257+ `Failed to install new package versions${
258+ packageManager ? ` with ${ packageManager . name } ` : ""
259+ } `
244260 ) ;
245261
246262 // Remove exit handler in case of failure
0 commit comments