<commit_before>configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist)

configuration.load do
	# define some extra folder to create
	set :shared_children, %w(files config/frontend config/backend config/library)

	# custom events configuration
	after 'deploy:setup' do
		forkcms.link_document_root
	end

	after 'deploy:update_code' do
		forkcms.link_configs
		forkcms.link_files
	end

	# Fork CMS specific tasks
	namespace :forkcms do
		desc 'Link the config files'
		task :link_configs do

			# change the path to current_path
			run "if [ -f #{shared_path}/config/library/globals.php ]; then sed -i 's/#{version_dir}\\/[0-9]*/#{current_dir}/' #{shared_path}/config/library/globals.php; fi"
			
			# symlink the globals
			run %{
				ln -sf #{shared_path}/config/library/globals.php #{release_path}/library/globals.php 
			}
		end

		desc 'link the document root to the current/default_www-folder'
		task :link_document_root do
			# create symlink for document_root if it doesn't exists
			documentRootExists = capture("if [ ! -e #{document_root} ]; then ln -sf #{current_path}/public #{document_root}; echo 'no'; fi").chomp

			unless documentRootExists == 'no'
				warn "Warning: Document root (#{document_root}) already exists"
				warn "to link it to the Fork deploy issue the following command:"
				warn "	ln -sf #{current_path}/public #{document_root}"
			end 
		end	

		desc 'Create needed symlinks'
		task :link_files do
			# get the list of folders in /frontend/files
			folders = capture("ls -1 #{release_path}/public/userfiles").split(/\r?\n/)

			# loop the folders
			folders.each do |folder|
				# copy them to the shared path, remove them from the release and symlink them
				run %{
					cp -r #{release_path}/public/userfiles/#{folder} #{shared_path}/files/#{folder} &&
					rm -rf #{release_path}/public/userfiles/#{folder} &&
					ln -s #{shared_path}/files/#{folder} #{release_path}/public/userfiles/#{folder}
				}
			end
		end	
	end
end
<commit_msg>changed for supershop purposes<commit_after>configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist)

configuration.load do
	# define some extra folder to create
	set :shared_children, %w(files config/frontend config/backend config/library)

	# custom events configuration
	after 'deploy:setup' do
		forkcms.link_document_root
	end

	after 'deploy:update_code' do
		forkcms.link_configs
		forkcms.link_files
	end

	# Fork CMS specific tasks
	namespace :forkcms do
		desc 'Link the config files'
		task :link_configs do

			# change the path to current_path
			run "if [ -f #{shared_path}/config/library/globals.php ]; then sed -i 's/#{version_dir}\\/[0-9]*/#{current_dir}/' #{shared_path}/config/library/globals.php; fi"
			
			# symlink the globals
			run %{
				ln -sf #{shared_path}/config/library/globals.php #{release_path}/library/globals.php 
			}
		end

		desc 'link the document root to the current/default_www-folder'
		task :link_document_root do
			# create symlink for document_root if it doesn't exists
			documentRootExists = capture("if [ ! -e #{document_root} ]; then ln -sf #{current_path}/default_www #{document_root}; echo 'no'; fi").chomp

			unless documentRootExists == 'no'
				warn "Warning: Document root (#{document_root}) already exists"
				warn "to link it to the Fork deploy issue the following command:"
				warn "	ln -sf #{current_path}/default_www #{document_root}"
			end 
		end	

		desc 'Create needed symlinks'
		task :link_files do
			# get the list of folders in /frontend/files
			folders = capture("ls -1 #{release_path}/default_www/userfiles").split(/\r?\n/)

			# loop the folders
			folders.each do |folder|
				# copy them to the shared path, remove them from the release and symlink them
				run %{
					cp -r #{release_path}/default_www/userfiles/#{folder} #{shared_path}/files/#{folder} &&
					rm -rf #{release_path}/default_www/userfiles/#{folder} &&
					ln -s #{shared_path}/files/#{folder} #{release_path}/default_www/userfiles/#{folder}
				}
			end
		end	
	end
end

{'fraction_non_alphanumeric': 0.11888278825495345, 'fraction_numerical': 0.0014323227500596801, 'mean_word_length': 3.988095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '5199522', 'n_tokens_mistral': 1511, 'n_tokens_neox': 1312, 'n_words': 373}