Allow importing IDE projects to non-empty directories with user confirmation by pritt20 · Pull Request #1981 · astronomer/astro-cli

Description

Previously, the astro ide project import command would fail if run in a non-empty directory, forcing users to create a new empty directory first. This change makes the experience more flexible by prompting users for confirmation before proceeding.

🎟 Issue(s)

Related #XXX

🧪 Functional Testing

Tested the change on locally:

~ astro ide project import
Current directory is not empty. Do you want to import the project here? /tmp/test (y/n) y
Only one Project was found. Using the following Project by default: 

 Project Name: test
 Project ID: cmhevveiz010501nlj05z8t8o

Successfully exported project from cmhevveiz010501nlj05z8t8o
~ astro ide project import
Current directory is not empty. Do you want to import the project here? /tmp/test/dags (y/n) n
Error: import canceled by user

📸 Screenshots

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation