Skip to content

Commit

Permalink
submit output_path and error_path in auto_output_directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Oct 28, 2024
1 parent ad329f6 commit bc646ef
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class AutoOutputDirectory < Attribute
# Value of auto_output_directory attribute
# Defaults to first script path in the project
# @return [String] attribute value
def value
directory_name(opts[:value] || 'Default Output Directory')
def error_path_value
"#{opts[:value]}/%j-output.log" || 'Default Output Directory'
end

def output_path_value
"#{opts[:value]}/%j-error.log" || 'Default Output Directory'
end

def widget
Expand All @@ -32,17 +36,9 @@ def label(*)
# @param fmt [String, nil] formatting of hash
# @return [Hash] submission hash
def submit(*)
{ script: { directory_name: value } }
{ script: { output_path: output_path_value, error_path: error_path_value } }
end

def directory_name(dir)
[
ENV['OOD_PORTAL'], # the OOD portal id
ENV['RAILS_RELATIVE_URL_ROOT'].to_s.sub(%r{^/[^/]+/}, ''), # the OOD app
'project-manager',
dir # the user supplied directory name
].reject(&:blank?).join('/')
end
end
end
end

0 comments on commit bc646ef

Please sign in to comment.