Skip to content

feat: expose PROJECT_DIR global for ake files#5

Merged
gutenye merged 1 commit into
mainfrom
feat/project-dir-global
Jun 7, 2026
Merged

feat: expose PROJECT_DIR global for ake files#5
gutenye merged 1 commit into
mainfrom
feat/project-dir-global

Conversation

@gutenye
Copy link
Copy Markdown
Owner

@gutenye gutenye commented Jun 6, 2026

Summary

Exposes a PROJECT_DIR global for ake files, set to the project directory (where the ake file lives). ake already chdirs into this directory before running a command; this makes the path available explicitly so scripts can reference the project root without relying on process.cwd().

  • PROJECT_DIR is assigned in #setupAke() right after process.chdir(projectDir).
  • It is set only for ake files, and only when a command runs — so it is undefined at the top level of the ake file (read it inside a command, or lazily).
  • Added a globals.d.ts declaration and docs in Ake.md and Global Commands.md.

Test Plan

  1. Create an ake file with a command that logs PROJECT_DIR.
  2. Run it from the project root: PROJECT_DIR equals the project root, matching process.cwd().
  3. Run it from a subdirectory (../ake <cmd>): PROJECT_DIR still resolves to the project root, not the subdirectory.
  • Follow the Plan

Screenshots

Made with Cursor

@gutenye gutenye force-pushed the feat/project-dir-global branch 3 times, most recently from 8885b2f to 00bc98d Compare June 7, 2026 04:53
Set a `PROJECT_DIR` global to the ake project directory (where the ake
file lives) right after chdir, so scripts can reference the project root
explicitly instead of relying on `process.cwd()`. Document it in the
global commands doc.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gutenye gutenye force-pushed the feat/project-dir-global branch from 00bc98d to 91ad25f Compare June 7, 2026 04:54
@gutenye gutenye marked this pull request as ready for review June 7, 2026 04:54
@gutenye gutenye merged commit ab3277b into main Jun 7, 2026
0 of 2 checks passed
@gutenye gutenye deleted the feat/project-dir-global branch June 7, 2026 04:55
github-actions Bot pushed a commit that referenced this pull request Jun 7, 2026
## [8.1.0](v8.0.1...v8.1.0) (2026-06-07)

### Features

* expose PROJECT_DIR global for ake files ([#5](#5)) ([ab3277b](ab3277b))
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

🎉 This PR is included in version 8.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant