Skip to content

Commit 0bfb7be

Browse files
authored
Improve swap-deps error handling for deleted directories (#47)
When swap-deps encounters a missing directory path (e.g., a deleted Conductor workspace), it now provides a helpful error message that: - Clearly states which path doesn't exist - Explains common causes (outdated .swap-deps.yml, deleted repo) - Suggests fixes (update config or use --restore) This makes the tool more user-friendly when dealing with stale configuration files that reference non-existent paths.
1 parent 4ee628c commit 0bfb7be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/demo_scripts/gem_swapper.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,15 @@ def validate_local_paths!
519519
gem_paths.each do |gem_name, path|
520520
next if File.directory?(path)
521521

522-
raise Error, "Local path for #{gem_name} does not exist: #{path}"
522+
error_msg = "Local path for #{gem_name} does not exist: #{path}\n\n"
523+
error_msg += "This usually means:\n"
524+
error_msg += " 1. The path in .swap-deps.yml is outdated\n"
525+
error_msg += " 2. You moved or deleted the local repository\n\n"
526+
error_msg += "To fix:\n"
527+
error_msg += " - Update .swap-deps.yml with the correct path\n"
528+
error_msg += ' - Or use --restore to restore original dependencies'
529+
530+
raise Error, error_msg
523531
end
524532
end
525533

0 commit comments

Comments
 (0)