From 1ea11b2a8f59a7855cdd2fcc05f684d2dfc7ccde Mon Sep 17 00:00:00 2001 From: Kevin De Pelseneer Date: Thu, 20 Jun 2024 09:50:51 +0200 Subject: [PATCH] Use FileUtils instead of raw shell commands --- app/controllers/templates_controller.rb | 8 ++++---- lib/seek/isa_templates/template_extractor.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 908b9e0b27..b099d8bdda 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -94,7 +94,7 @@ def populate_template dir = Seek::Config.append_filestore_path('source_types') if Dir.exist?(dir) - `rm #{dir}/*` + FileUtils.delete(Dir.glob("#{dir}/*")) else FileUtils.mkdir_p(dir) end @@ -172,7 +172,7 @@ def set_status elsif File.exist?(resultfile) res = File.read(resultfile) @status = res - `rm #{resultfile}` + FileUtils.delete(resultfile) else @status = 'not_started' end @@ -187,12 +187,12 @@ def resultfile end def running! - `touch #{lockfile}` + FileUtils.touch(lockfile) set_status end def done! - `rm -f #{lockfile}` + FileUtils.delete(lockfile) end def running? diff --git a/lib/seek/isa_templates/template_extractor.rb b/lib/seek/isa_templates/template_extractor.rb index 18dbe5f1d6..4f11d633db 100644 --- a/lib/seek/isa_templates/template_extractor.rb +++ b/lib/seek/isa_templates/template_extractor.rb @@ -4,7 +4,7 @@ module Seek module IsaTemplates module TemplateExtractor def self.extract_templates - `touch #{resultfile}` + FileUtils.touch(resultfile) result = StringIO.new seed_isa_tags