From ae041fc5a0b90bbfbf6dae2f06389a15e8ee6a55 Mon Sep 17 00:00:00 2001 From: Malek Kamel Date: Sat, 26 Oct 2024 17:21:39 +0300 Subject: [PATCH] Optimize .gitignore: Use root-relative paths to avoid unintended ignores --- solara/lib/core/scripts/gitignore_manager.rb | 4 +--- solara/lib/core/scripts/resource_manifest_processor.rb | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/solara/lib/core/scripts/gitignore_manager.rb b/solara/lib/core/scripts/gitignore_manager.rb index 084b85f..e999e8c 100644 --- a/solara/lib/core/scripts/gitignore_manager.rb +++ b/solara/lib/core/scripts/gitignore_manager.rb @@ -18,9 +18,7 @@ def self.ignore_common_files ] if Platform.is_flutter || Platform.is_ios - items << FileManager.get_relative_path_to_root(FilePath.project_infoplist_string_catalog) - # The excluded InfoPlist.xcstrings maybe at the root. In this case we have to avoid ignoring the brands files. - items << '!solara/brand/brands/**/InfoPlist.xcstrings' + items << "/#{FileManager.get_relative_path_to_root(FilePath.project_infoplist_string_catalog)}" end GitignoreManager.new(FilePath.project_root).add_items(items) diff --git a/solara/lib/core/scripts/resource_manifest_processor.rb b/solara/lib/core/scripts/resource_manifest_processor.rb index 4cda05f..7133828 100644 --- a/solara/lib/core/scripts/resource_manifest_processor.rb +++ b/solara/lib/core/scripts/resource_manifest_processor.rb @@ -89,7 +89,7 @@ def destinations_of_directory_contents(src_dir, dst_dir) def git_ignore(files) files.each do |file| - GitignoreManager.new(FilePath.project_root).add_items([file]) + GitignoreManager.new(FilePath.project_root).add_items(["/#{file}"]) end end