File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -221,15 +221,16 @@ export async function deploy(
221
221
const mostRecentSourceMtimeMs = await findMostRecentSourceMtimeMs ( effects , config ) ;
222
222
const buildAge = Date . now ( ) - leastRecentBuildMtimeMs ;
223
223
let initialValue = buildAge > BUILD_AGE_WARNING_MS ;
224
- let message = "" ;
225
224
if ( mostRecentSourceMtimeMs > leastRecentBuildMtimeMs ) {
226
- message += "Your source files have changed since the last time you built. " ;
225
+ clack . log . warn (
226
+ wrapAnsi ( `Your source files have changed since you built ${ formatAge ( buildAge ) } .` , effects . outputColumns )
227
+ ) ;
227
228
initialValue = true ;
229
+ } else {
230
+ clack . log . info ( wrapAnsi ( `You built this project ${ formatAge ( buildAge ) } .` , effects . outputColumns ) ) ;
228
231
}
229
- message += `You built this project ${ formatAge ( buildAge ) } . ` ;
230
- message += "Would you like to build again before deploying?" ;
231
232
const choice = await clack . confirm ( {
232
- message,
233
+ message : "Would you like to build again before deploying?" ,
233
234
initialValue,
234
235
active : "Yes, build and then deploy" ,
235
236
inactive : "No, deploy as is"
Original file line number Diff line number Diff line change @@ -777,7 +777,10 @@ describe("deploy", () => {
777
777
fixedInputStatTime : new Date ( "2024-03-09" ) ,
778
778
fixedOutputStatTime : new Date ( "2024-03-10" )
779
779
} ) ;
780
- await assert . rejects ( ( ) => deploy ( deployOptions , effects ) , / o u t o f i n p u t s f o r s e l e c t : Y o u b u i l t t h i s p r o j e c t / ) ;
780
+ await assert . rejects (
781
+ ( ) => deploy ( deployOptions , effects ) ,
782
+ / o u t o f i n p u t s f o r s e l e c t : W o u l d y o u l i k e t o b u i l d a g a i n /
783
+ ) ;
781
784
effects . close ( ) ;
782
785
} ) ;
783
786
@@ -794,7 +797,7 @@ describe("deploy", () => {
794
797
} ) ;
795
798
await assert . rejects (
796
799
( ) => deploy ( deployOptions , effects ) ,
797
- / o u t o f i n p u t s f o r s e l e c t : Y o u r s o u r c e f i l e s h a v e c h a n g e d /
800
+ / o u t o f i n p u t s f o r s e l e c t : W o u l d y o u l i k e t o b u i l d a g a i n /
798
801
) ;
799
802
effects . close ( ) ;
800
803
} ) ;
You can’t perform that action at this time.
0 commit comments