From 4ba4b574e86cb474d9e14434e9f48f2da1a0723e Mon Sep 17 00:00:00 2001 From: Malek Kamel Date: Mon, 23 Sep 2024 12:18:36 +0300 Subject: [PATCH] Solara --- solara/lib/core/scripts/directory_creator.rb | 2 +- solara/lib/core/scripts/interactive_file_system_validator.rb | 1 + .../core/scripts/platform/android/android_strings_switcher.rb | 2 ++ solara/lib/solara_initializer.rb | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/solara/lib/core/scripts/directory_creator.rb b/solara/lib/core/scripts/directory_creator.rb index 36ae6fb..3cef053 100644 --- a/solara/lib/core/scripts/directory_creator.rb +++ b/solara/lib/core/scripts/directory_creator.rb @@ -15,7 +15,7 @@ def self.create_directory(dir, delete_if_exists) Dir.mkdir(dir) end else - Dir.mkdir(dir) + FileUtils.mkdir_p(dir) end Solara.logger.debug("✨ Created directory: #{dir}") end diff --git a/solara/lib/core/scripts/interactive_file_system_validator.rb b/solara/lib/core/scripts/interactive_file_system_validator.rb index 47afadc..1e50be3 100644 --- a/solara/lib/core/scripts/interactive_file_system_validator.rb +++ b/solara/lib/core/scripts/interactive_file_system_validator.rb @@ -35,6 +35,7 @@ def validate(file_system) end else ignored = [ + 'macos/', 'solara/', "#{FilePath.artifacts_dir_name}/", "#{FilePath.artifacts_dir_name_ios}/", diff --git a/solara/lib/core/scripts/platform/android/android_strings_switcher.rb b/solara/lib/core/scripts/platform/android/android_strings_switcher.rb index 0cf4cd6..b77f020 100644 --- a/solara/lib/core/scripts/platform/android/android_strings_switcher.rb +++ b/solara/lib/core/scripts/platform/android/android_strings_switcher.rb @@ -18,6 +18,8 @@ def switch # It's important to delete app_name to avoid duplicate resources def remove_app_name_from_strings file_path = FilePath.android_strings + return unless File.exist?(file_path) + manager = StringsXmlManager.new(file_path) manager.delete_app_name Solara.logger.debug("Removed app_name from #{file_path} to avoid duplicates with #{FilePath.android_artifacts_strings}.") diff --git a/solara/lib/solara_initializer.rb b/solara/lib/solara_initializer.rb index 90f8515..a8b7d7c 100644 --- a/solara/lib/solara_initializer.rb +++ b/solara/lib/solara_initializer.rb @@ -20,6 +20,9 @@ def initialize(brand_key, brand_name) def init Solara.logger.header("Initializing Solara") confirm_init_if_necessary + + ProjectDoctor.new.visit + message = "Initialized #{SolaraSettingsManager.instance.platform} successfully." SolaraManager.new.onboard(@brand_key, @brand_name, init: true, success_message: message) end