Skip to content

Commit 2be1062

Browse files
amuwalericallam
andauthored
fix: unintended project initialization at absolute path /trigger during project initialization (#1412)
* Fix parsing of project path for cli init command * Update development instructions for cli-v3 * Create gentle-mails-sip.md --------- Co-authored-by: Eric Allam <[email protected]>
1 parent 64be7b0 commit 2be1062

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.changeset/gentle-mails-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
fix: unintended project initialization at absolute path `/trigger` during project initialization

packages/cli-v3/DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ cd packages/cli-v3
77
pnpm run dev
88
```
99

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

1212
```sh
1313
pnpm i
14-
pnpm exec trigger-v3-cli
14+
pnpm exec trigger <command>
1515
```
1616

1717
---

packages/cli-v3/src/commands/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ async function createTriggerDir(
229229
throw new OutroCommandError();
230230
}
231231

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

234237
logger.debug({ triggerDir });
235238

0 commit comments

Comments
 (0)