Sha256: f0988d47d7824c24d69088ca03a372a8157b6df2533f5e9287f457a31a26a105
Contents?: true
Size: 1.42 KB
Versions: 57
Compression:
Stored size: 1.42 KB
Contents
# frozen_string_literal: true module Avm module EacWebappBase0 module Instances class Deploy class SetupFilesUnit < ::SimpleDelegator enable_method_class attr_reader :data_key, :fs_path_subpath def initialize(deploy, data_key, fs_path_subpath) super(deploy) @data_key = data_key @fs_path_subpath = fs_path_subpath end def result assert_source_directory link_source_target end def assert_source_directory infom "Asserting \"#{data_key}\" source directory..." instance.host_env.command('mkdir', '-p', source_path).execute! end def source_path ::File.join(instance.install_data_path, data_key.to_s) end def target_path ::File.join(instance.read_entry(::Avm::Instances::EntryKeys::INSTALL_PATH), fs_path_subpath.to_s) end def link_source_target infom "Linking \"#{data_key}\" directory..." return unless remove_target instance.host_env.command('ln', '-s', source_path, target_path).execute! end private # @return [Boolean] def remove_target instance.host_env.command('rm', '-rf', target_path).execute.fetch(:exit_code).zero? end end end end end end
Version data entries
57 entries across 57 versions & 2 rubygems