Skip to content
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

fix(cli): respect custom buildDir option for tasks sub command #2635

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

TMBL-DEV
Copy link
Contributor

updated list & run to get a nitro instance and grab the buildDir from the nitro options and at the close the nitro instance.

🔗 Linked issue

#2634 Task cli forces .nitro as buildDir

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Changes

In run.ts & list.ts from the task command i used createNitro() to have a nitro instance so i could access the options.
i use the nitro.options.builDir to replace the hardcoded ".nitro" buildDir that is passed to the runTask function.
at the end of the command run function i also close the the nitro instance that i created.

Why

Now if your buildDir in the nitro.config.ts is not the default .nitro directory instead of getting an error it uses the correct buildDir and your command will run.
This will also make sure that the task cli works with nuxt, because nuxt uses the the buildDir .nuxt.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

updated list & run to get a nitro instance and grab the buildDir from the nitro options and at the close the nitro instance.
@pi0 pi0 changed the title fix(Tasks): replace hardcoded buildDir with nitro.options buildDir fix(cli): respect custom buildDir option Jul 26, 2024
@pi0 pi0 changed the title fix(cli): respect custom buildDir option fix(cli): respect custom buildDir option for tasks sub command Jul 26, 2024
src/cli/commands/task/list.ts Outdated Show resolved Hide resolved
@TMBL-DEV TMBL-DEV requested a review from pi0 July 31, 2024 11:01
@TMBL-DEV
Copy link
Contributor Author

@pi0 is this good?

@TMBL-DEV TMBL-DEV mentioned this pull request Sep 13, 2024
@pi0 pi0 merged commit cb09358 into nitrojs:v2 Sep 20, 2024
4 checks passed
@pi0 pi0 mentioned this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants