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

Interactive CLI option for move_to_folder #140

Merged
merged 8 commits into from
Jan 5, 2024
Merged

Conversation

schoblaska
Copy link
Contributor

@schoblaska schoblaska commented Dec 21, 2023

Adds an interactive CLI option for the move_to_folder command added in #136.

Both move_to_folder and move_to_parent are nested under a top-level CLI option "Move a pack."

If you attempt to move a pack into a folder that happens to be a pack itself, you get a warning message and are given the chance to use the move_to_parent command instead.

$ bin/packs
Hello! What would you like to do? (Press ↑/↓ arrow to move, Enter to select
nd letters to filter)
  1. Create a new pack
  2. Move files
‣ 3. Move a pack
  4. Add a dependency
  5. Get info on one or more packs
  6. Query violations about a pack
  7. Make files or directories public
  8. Rename a pack
  9. Run bin/packwerk check
  10. Run bin/packwerk update
  11. Run bin/packwerk validate (detects cycles)
  12. Lint packs/*/package.yml for one or more packs

Hello! What would you like to do? Move a pack
What do you want to do? (Press ↑/↓ arrow to move and Enter to select)
‣ Move a child pack to be nested under a parent pack
  Move a pack to a folder that is not a pack
  
$ bin/packs
Hello! What would you like to do? Move a pack
What do you want to do? Move a pack to a folder that is not a pack
Please select the pack that you want to move packs/foo
What directory do you want to move packs/foo to? packs/bar
The directory packs/bar contains a pack. Add foo as a dependency?
(Press ↑/↓ arrow to move and Enter to select)
‣ Yes
  No

Fixes #135

@perryqh
Copy link
Contributor

perryqh commented Dec 21, 2023

Really solid PR! I just have a question about testing.

@schoblaska schoblaska enabled auto-merge (squash) January 4, 2024 21:53
@schoblaska schoblaska merged commit b48cfc4 into main Jan 5, 2024
14 checks passed
@schoblaska schoblaska deleted the mod/move-pack-cli branch January 5, 2024 21:04
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.

Proposal: move pack to folder
3 participants