Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
euler-room committed Oct 31, 2024
1 parent 262edb7 commit c6dc975
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions apps/dashboard/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ def sync_template
# that point to the _new_ project directory, not the template's directory.
# This creates them _and_ serializes them to yml in the new directory.
def save_new_launchers
dir = Launcher.scripts_dir(template)
Dir.glob("#{dir}/*/form.yml").map do |script_yml|
Launcher.from_yaml(script_yml, project_dataroot)
end.map do |script|
saved_successfully = script.save
errors.add(:save, script.errors.full_messages) unless saved_successfully
dir = Launcher.launchers_dir(template)
Dir.glob("#{dir}/*/form.yml").map do |launcher_yml|
Launcher.from_yaml(launcher_yml, project_dataroot)
end.map do |launcher|
saved_successfully = launcher.save
errors.add(:save, launcher.errors.full_messages) unless saved_successfully

saved_successfully
end.all? do |saved_successfully|
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/test/models/projects_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ class ProjectsTest < ActiveSupport::TestCase
template_dir = File.join(tmp,'template')
job_log_path = "#{template_dir}/.ondemand/job_log.yml"
launcher_id = '50r4nd0m'
cache_json_path = "#{template_dir}/.ondemand/scripts/#{launcher_id}/cache.json"
cache_json_path = "#{template_dir}/.ondemand/launchers/#{launcher_id}/cache.json"

file_content = <<~HEREDOC
some multiline content
echo 'multiline content'
description: multiline content
HEREDOC
Pathname.new("#{template_dir}/.ondemand/scripts/#{launcher_id}").mkpath
Pathname.new("#{template_dir}/.ondemand/launchers/#{launcher_id}").mkpath
File.open(job_log_path, 'w') { |file| file.write(file_content) }
File.open(cache_json_path, 'w') { |file| file.write(file_content) }

Expand Down

0 comments on commit c6dc975

Please sign in to comment.