@@ -648,6 +648,22 @@ def self.create_project_folder(dir_name, empty_folder: false, overwrite_project:
648648 FileUtils . cp ( example_files_dir / 'runner.conf' , project_path )
649649 use_num_parallel ( project_path )
650650
651+ # if env variable for gemfile_path and bundle_install_path is set, open the runner.conf
652+ # and update the gemfile_path and bundle_install_path values
653+ if ENV [ 'UO_GEMFILE_PATH' ] || ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
654+ runner_file_path = project_path / 'runner.conf'
655+ runner_conf_hash = JSON . parse ( File . read ( runner_file_path ) )
656+ if ENV [ 'UO_GEMFILE_PATH' ]
657+ runner_conf_hash [ 'gemfile_path' ] = ENV [ 'UO_GEMFILE_PATH' ]
658+ end
659+ if ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
660+ runner_conf_hash [ 'bundle_install_path' ] = ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
661+ end
662+ File . open ( runner_file_path , 'w+' ) do |f |
663+ f << runner_conf_hash . to_json
664+ end
665+ end
666+
651667 # copy gemfile
652668 FileUtils . cp ( example_files_dir / 'Gemfile' , project_path )
653669
@@ -837,6 +853,22 @@ def self.update_project(existing_project_folder, new_project_directory)
837853 FileUtils . cp_r ( example_files_dir / 'runner.conf' , new_path , remove_destination : true )
838854 use_num_parallel ( new_path )
839855
856+ # if env variable for gemfile_path and bundle_install_path is set, open the runner.conf
857+ # and update the gemfile_path and bundle_install_path values
858+ if ENV [ 'UO_GEMFILE_PATH' ] || ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
859+ runner_file_path = project_path / 'runner.conf'
860+ runner_conf_hash = JSON . parse ( File . read ( runner_file_path ) )
861+ if ENV [ 'UO_GEMFILE_PATH' ]
862+ runner_conf_hash [ 'gemfile_path' ] = ENV [ 'UO_GEMFILE_PATH' ]
863+ end
864+ if ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
865+ runner_conf_hash [ 'bundle_install_path' ] = ENV [ 'UO_BUNDLE_INSTALL_PATH' ]
866+ end
867+ File . open ( runner_file_path , 'w+' ) do |f |
868+ f << runner_conf_hash . to_json
869+ end
870+ end
871+
840872 # Replace standard mappers
841873 # FIXME: this also copies createBar and Floorspace without checking project type (for now)
842874 mappers = example_files_dir / 'mappers'
0 commit comments