From 28343421eb673e7eba25a89a370df67009349165 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 25 Nov 2025 22:20:13 +0000 Subject: [PATCH 1/2] Refactor move command to accept destination pack as last argument Co-authored-by: martin.emde --- README.md | 3 ++- lib/packs/cli.rb | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7bfb2d1..68665a5 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,12 @@ This moves a file or directory to public API (either the `app/public` folder or Make sure there are no spaces between the comma-separated list of paths of directories. ## Move files or directories from one pack to another -`bin/packs move packs/destination_pack path/to/file.rb path/to/directory` +`bin/packs move path/to/file.rb path/to/directory packs/destination_pack` This is used for moving files into a pack (the pack must already exist). Note this works for moving files to packs from the monolith or from other packs +The last argument is the destination pack. All previous arguments are the paths to move. Make sure there are no spaces between the comma-separated list of paths of directories. ## Lint `package_todo.yml` files to check for formatting issues diff --git a/lib/packs/cli.rb b/lib/packs/cli.rb index 769c3f3..5e610d2 100644 --- a/lib/packs/cli.rb +++ b/lib/packs/cli.rb @@ -82,15 +82,19 @@ def make_public(*paths) exit_successfully end - desc 'move packs/destination_pack path/to/file.rb path/to/directory', 'Move files or directories from one pack to another' + desc 'move path/to/file.rb path/to/directory packs/destination_pack', 'Move files or directories from one pack to another' long_desc <<~LONG_DESC This is used for moving files into a pack (the pack must already exist). Note this works for moving files to packs from the monolith or from other packs + The last argument is the destination pack. All previous arguments are the paths to move. Make sure there are no spaces between the comma-separated list of paths of directories. LONG_DESC - sig { params(pack_name: String, paths: String).void } - def move(pack_name, *paths) + sig { params(args: String).void } + def move(*args) + raise StandardError, 'At least two arguments required: source path(s) and destination pack' if args.length < 2 + + *paths, pack_name = args Packs.move_to_pack!( pack_name: pack_name, paths_relative_to_root: paths From 7bb0564299eff5744c8824b0ed62dde16e40eef4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 25 Nov 2025 22:50:16 +0000 Subject: [PATCH 2/2] Refactor: Use T.must for pack name and paths in CLI Co-authored-by: martin.emde --- lib/packs/cli.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/packs/cli.rb b/lib/packs/cli.rb index 5e610d2..265cce9 100644 --- a/lib/packs/cli.rb +++ b/lib/packs/cli.rb @@ -96,8 +96,8 @@ def move(*args) *paths, pack_name = args Packs.move_to_pack!( - pack_name: pack_name, - paths_relative_to_root: paths + pack_name: T.must(pack_name), + paths_relative_to_root: T.must(paths) ) exit_successfully end