Skip to content

Commit

Permalink
Use FileUtils instead of raw shell commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Jun 20, 2024
1 parent b98f42b commit 1ea11b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/controllers/templates_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion lib/seek/isa_templates/template_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1ea11b2

Please sign in to comment.