Skip to content

Commit

Permalink
Update Solara
Browse files Browse the repository at this point in the history
  • Loading branch information
MalekKamel committed Sep 24, 2024
1 parent 6c0a748 commit 807456d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions solara/lib/core/scripts/file_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,18 @@ def self.find_files_by_extension(directory, extension)
end

def self.find_files_by_name(directory, filename)
Dir.glob(File.join(directory, "**", filename)).to_a
end
# Ensure proper path formatting
directory = File.expand_path(directory)

# Generate the search pattern
pattern = File.join(directory, "**", filename)

# Output the pattern for debugging
Solara.logger.debug("Searching for: #{pattern}")

# Find and return matching files
Dir.glob(pattern).to_a
end

def self.get_relative_path(root_dir, sub_dir)
Pathname(sub_dir).relative_path_from(Pathname(root_dir)).to_s
Expand Down

0 comments on commit 807456d

Please sign in to comment.