Merge branch 'bugfix/cli-init' of https://github.com/Chigala/trigger.dev into Chigala-bugfix/cli-init

This commit is contained in:
Eric Allam
2023-08-22 10:57:05 +01:00
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---
fixed the cli init log message to show the correct path to the app route created
+9 -1
View File
@@ -527,7 +527,11 @@ export * from "./examples"
await fs.writeFile(pathModule.join(directories, routeFileName), routeContent);
logger.success(`✅ Created app route at ${usesSrcDir ? "src/" : ""}app/api/trigger.ts`);
logger.success(
`✅ Created app route at ${usesSrcDir ? "src/" : ""}app/api/${removeFileExtension(
triggerFileName
)}/${routeFileName}`
);
const triggerFileExists = await pathExists(pathModule.join(path, triggerFileName));
@@ -735,3 +739,7 @@ async function setupEnvironmentVariable(
logger.success(`✅ Added ${variableName}=${renderer(value)} to ${fileName}`);
}
}
function removeFileExtension(filename: string) {
return filename.replace(/\.[^.]+$/, "");
}