diff options
Diffstat (limited to 'app/services/projects/import_export/project_tree_saver.rb')
-rw-r--r-- | app/services/projects/import_export/project_tree_saver.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/services/projects/import_export/project_tree_saver.rb b/app/services/projects/import_export/project_tree_saver.rb index 4801c791ffe..3ca90d1f79a 100644 --- a/app/services/projects/import_export/project_tree_saver.rb +++ b/app/services/projects/import_export/project_tree_saver.rb @@ -3,19 +3,20 @@ module Projects class ProjectTreeSaver attr_reader :full_path - def initialize(project: ) + def initialize(project: , shared: ) @project = project + @export_path = shared.export_path end def save - @full_path = File.join(export_path, project_filename) + @full_path = File.join(@export_path, project_filename) save_to_disk end private def save_to_disk - FileUtils.mkdir_p(export_path) + FileUtils.mkdir_p(@export_path) File.write(full_path, project_json_tree) true rescue @@ -23,10 +24,6 @@ module Projects false end - def export_path - @export_path ||= ImportExport.export_path(@project.name) - end - def project_filename # TODO sanitize name "#{@project.name}.json" |