lib/zci/commands/02_import.rb in zci-0.0.3 vs lib/zci/commands/02_import.rb in zci-0.0.4

- old
+ new

@@ -19,11 +19,11 @@ # Source Category source_category_id = category['zendesk_category'].to_i # Check if Category exists in Zendesk source_category = @zendesk.hc_categories.find(id: source_category_id) - raise('No such category') unless source_category.id == source_category_id + raise('No such category') if source_category.nil? || source_category.id != source_category_id # Get category's sections in Zendesk puts "[Zendesk] Get sections for Category with id #{source_category_id}" sections = source_category.sections @@ -53,9 +53,10 @@ crowdin_project_info = @crowdin.project_info remote_project_tree = get_remote_files_hierarchy(crowdin_project_info['files']) resources_category_dir = File.join(resources_dir, source_category_id.to_s) + unless File.exists?(resources_category_dir) FileUtils.mkdir(resources_category_dir) end # Create directory for Category on Crowdin if it does not exist yet