Skip to content

fix: unintended project initialization at absolute path /trigger during project initialization #1412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gentle-mails-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

fix: unintended project initialization at absolute path `/trigger` during project initialization
4 changes: 2 additions & 2 deletions packages/cli-v3/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ cd packages/cli-v3
pnpm run dev
```

2. In the job-catalog folder you can use the CLI
2. Test the local CLI using the job-catalogs located in the `/references` directory

```sh
pnpm i
pnpm exec trigger-v3-cli
pnpm exec trigger <command>
```

---
Expand Down
5 changes: 4 additions & 1 deletion packages/cli-v3/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ async function createTriggerDir(
throw new OutroCommandError();
}

const triggerDir = resolve(process.cwd(), location);
// Ensure that the path is always relative by stripping leading '/' if present
const relativeLocation = location.replace(/^\//, "");

const triggerDir = resolve(process.cwd(), relativeLocation);

logger.debug({ triggerDir });

Expand Down