@@ -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 (
@@ -74,7 +74,7 @@ export async function updateTriggerPackages(
7474
7575 const newCliVersion = await updateCheck ( ) ;
7676
77- if ( newCliVersion ) {
77+ if ( newCliVersion && ! cliVersion . startsWith ( "0.0.0" ) ) {
7878 prettyWarning (
7979 "You're not running the latest CLI version, please consider updating ASAP" ,
8080 `Current: ${ cliVersion } \nLatest: ${ newCliVersion } ` ,
@@ -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.
@@ -162,8 +168,7 @@ export async function updateTriggerPackages(
162168 }
163169
164170 // WARNING: We can only start accepting user input once we know this is a TTY, otherwise, the process will exit with an error in CI
165-
166- if ( isDowngrade ) {
171+ if ( isDowngrade && embedded ) {
167172 printUpdateTable ( "Versions" , mismatches , cliVersion , "installed" , "CLI" ) ;
168173
169174 outro ( "CLI update required!" ) ;
@@ -187,14 +192,20 @@ export async function updateTriggerPackages(
187192
188193 if ( ! userWantsToUpdate ) {
189194 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 ) ;
195+ if ( embedded ) {
196+ outro ( "You shall not pass!" ) ;
197+
198+ logger . log (
199+ `${ chalkError (
200+ "X Error:"
201+ ) } Update required: Version mismatches are a common source of bugs and errors. Please update or use \`--skip-update-check\` at your own risk.\n`
202+ ) ;
203+ process . exit ( 1 ) ;
204+ } else {
205+ outro ( "No updates applied" ) ;
206+
207+ process . exit ( 0 ) ;
208+ }
198209 }
199210
200211 if ( ! embedded ) {
@@ -205,7 +216,7 @@ export async function updateTriggerPackages(
205216 }
206217
207218 const installSpinner = spinner ( ) ;
208- installSpinner . start ( "Writing new package.json file " ) ;
219+ installSpinner . start ( "Updating dependencies in package.json" ) ;
209220
210221 // Backup package.json
211222 const packageJsonBackupPath = `${ packageJsonPath } .bak` ;
@@ -235,12 +246,16 @@ export async function updateTriggerPackages(
235246 const packageManager = await detectPackageManager ( projectPath ) ;
236247
237248 try {
238- installSpinner . message ( `Installing new package versions with ${ packageManager } ` ) ;
249+ installSpinner . message (
250+ `Installing new package versions${ packageManager ? ` with ${ packageManager . name } ` : "" } `
251+ ) ;
239252
240- await installDependencies ( { cwd : projectPath } ) ;
253+ await installDependencies ( { cwd : projectPath , silent : true } ) ;
241254 } catch ( error ) {
242255 installSpinner . stop (
243- `Failed to install new package versions${ packageManager ? ` with ${ packageManager } ` : "" } `
256+ `Failed to install new package versions${
257+ packageManager ? ` with ${ packageManager . name } ` : ""
258+ } `
244259 ) ;
245260
246261 // Remove exit handler in case of failure
0 commit comments