require 'evrone/ci/common' module Evrone module CI module Worker LocalCreateDirs = Struct.new(:app) do include Common::Helper::Shell include Worker::Helper::Config def call(env) tmp_dir! env work_dir! env repo_dir! env app.call env end private def tmp_dir!(env) env.tmp_dir = env.path_prefix.join(config.tmp_dir_name) .join(env.job.message.name) recreate env.tmp_dir end def work_dir!(env) env.work_dir = env.path_prefix.join(config.work_dir_name) .join(env.job.message.name) recreate env.work_dir end def repo_dir!(env) env.repo_dir = env.path_prefix.join(config.repo_dir_name) .join(env.job.message.name) mkdir env.repo_dir end end end end end