-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_tool_paths.rb
More file actions
50 lines (40 loc) · 1.16 KB
/
fix_tool_paths.rb
File metadata and controls
50 lines (40 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env ruby
require 'xcodeproj'
project_path = 'MLX Code.xcodeproj'
project = Xcodeproj::Project.open(project_path)
# Get the main target
target = project.targets.first
# Find the Tools group
main_group = project.main_group['MLX Code']
tools_group = main_group['Tools']
if tools_group.nil?
puts "Error: Tools group not found"
exit 1
end
# List of tool files
tool_files = [
'ToolProtocol.swift',
'MemorySystem.swift',
'FileOperationsTool.swift',
'BashTool.swift',
'GrepTool.swift',
'GlobTool.swift',
'XcodeTool.swift',
'ToolRegistry.swift',
'SystemPrompts.swift'
]
# Remove old references and add new ones with correct paths
tool_files.each do |filename|
# Remove any existing file reference
existing_ref = tools_group.files.find { |f| f.path == filename }
if existing_ref
target.source_build_phase.remove_file_reference(existing_ref)
existing_ref.remove_from_project
end
# Add file with correct path
file_ref = tools_group.new_reference("Tools/#{filename}")
target.source_build_phase.add_file_reference(file_ref)
puts "Fixed: #{filename}"
end
project.save
puts "\nSuccessfully fixed #{tool_files.count} tool file paths"