<commit_before>require File.dirname(__FILE__) + '/../capistrano-helpers' if ! defined?(CapistranoHelpers)

CapistranoHelpers.with_configuration do
 
  namespace :deploy do
    desc 'Replace named files with a symlink to their counterparts in shared/private/'
    task :symlink_privates do
      if !exists?(:privates)
        abort 'You must specify which privates to symlink using the "set :privates" command.'
      end
      privates.each do |path|
        if release_path.nil? || release_path.empty? || path.nil? || path.empty?
          raise "Release path or path are nil!"
        end
        run "rm -rf #{release_path}/#{path} && ln -nfs #{shared_path}/private/#{path} #{release_path}/#{path}"
      end
    end
  end

  before "deploy:finalize_update", "deploy:symlink_privates"<commit_msg>Create a private directory in shared after setup<commit_after>require File.dirname(__FILE__) + '/../capistrano-helpers' if ! defined?(CapistranoHelpers)

CapistranoHelpers.with_configuration do

  namespace :deploy do
    desc 'Replace named files with a symlink to their counterparts in shared/private/'
    task :symlink_privates do
      if !exists?(:privates)
        abort 'You must specify which privates to symlink using the "set :privates" command.'
      end
      privates.each do |path|
        if release_path.nil? || release_path.empty? || path.nil? || path.empty?
          raise "Release path or path are nil!"
        end
        run "rm -rf #{release_path}/#{path} && ln -nfs #{shared_path}/private/#{path} #{release_path}/#{path}"
      end
    end

    desc '[internal] Create a private directory in shared'
    task :create_private_dir do
      private_dir = 'private'
      private_path = File.join(shared_path, private_dir)
      run "#{try_sudo} mkdir -p #{private_path}"
      run "#{try_sudo} chmod o-rwx #{private_path}"
    end
  end

  before "deploy:finalize_update", "deploy:symlink_privates"
  after "deploy:setup", "deploy:create_private_dir"
{'fraction_non_alphanumeric': 0.11144883485309018, 'fraction_numerical': 0.0, 'mean_word_length': 3.379157427937916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2212443', 'n_tokens_mistral': 600, 'n_tokens_neox': 597, 'n_words': 178}