@@ -280,10 +280,7 @@ async function detectUseOfSrcDir(path: string): Promise<boolean> {
280280
281281// Detect the use of pages or app dir in the Next.js project
282282// Import the next.config.js file and check for experimental: { appDir: true }
283- async function detectPagesOrAppDir (
284- path : string ,
285- usesSrcDir = false ,
286- ) : Promise < "pages" | "app" > {
283+ async function detectPagesOrAppDir ( path : string , usesSrcDir = false ) : Promise < "pages" | "app" > {
287284 const nextConfigPath = pathModule . join ( path , "next.config.js" ) ;
288285 const importedConfig = await import ( pathToFileURL ( nextConfigPath ) . toString ( ) ) . catch ( ( ) => ( { } ) ) ;
289286
@@ -527,7 +524,11 @@ export * from "./examples"
527524
528525 await fs . writeFile ( pathModule . join ( directories , routeFileName ) , routeContent ) ;
529526
530- logger . success ( `✅ Created app route at ${ usesSrcDir ? "src/" : "" } app/api/trigger.ts` ) ;
527+ logger . success (
528+ `✅ Created app route at ${ usesSrcDir ? "src/" : "" } app/api/${ removeFileExtension (
529+ triggerFileName
530+ ) } /${ routeFileName } `
531+ ) ;
531532
532533 const triggerFileExists = await pathExists ( pathModule . join ( path , triggerFileName ) ) ;
533534
@@ -550,9 +551,7 @@ export * from "./examples"
550551 examplesIndexContent
551552 ) ;
552553
553- logger . success (
554- `✅ Created example job at ${ usesSrcDir ? "src/" : "" } jobs/examples/examplesFileName`
555- ) ;
554+ logger . success ( `✅ Created example job at ${ usesSrcDir ? "src/" : "" } jobs/examples.ts` ) ;
556555 }
557556}
558557
@@ -735,3 +734,7 @@ async function setupEnvironmentVariable(
735734 logger . success ( `✅ Added ${ variableName } =${ renderer ( value ) } to ${ fileName } ` ) ;
736735 }
737736}
737+
738+ function removeFileExtension ( filename : string ) {
739+ return filename . replace ( / \. [ ^ . ] + $ / , "" ) ;
740+ }
0 commit comments