<commit_before>#!/usr/bin/env bash

#
#   Copyright 2017 <NAME>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#

function __sdk_flush {
	local qualifier="$1"

	case "$qualifier" in
		broadcast)
			if [[ -f "${SDKMAN_DIR}/var/broadcast_id" ]]; then
				rm "${SDKMAN_DIR}/var/broadcast_id"
				rm "${SDKMAN_DIR}/var/broadcast"
				__sdkman_echo_green "Broadcast has been flushed."
			else
				__sdkman_echo_no_colour "No prior broadcast found so not flushed."
			fi
			;;
		version)
			if [[ -f "${SDKMAN_DIR}/var/version" ]]; then
				rm "${SDKMAN_DIR}/var/version"
				__sdkman_echo_green "Version file has been flushed."
			else
				__sdkman_echo_no_colour "No prior Remote Version found so not flushed."
			fi
			;;
		archives)
			__sdkman_cleanup_folder "archives"
			;;
		temp)
			__sdkman_cleanup_folder "tmp"
			;;
		tmp)
			__sdkman_cleanup_folder "tmp"
			;;
		*)
			__sdkman_echo_red "Stop! Please specify what you want to flush."
			;;
	esac
}

function __sdkman_cleanup_folder {
	local folder="$1"
	sdkman_cleanup_dir="${SDKMAN_DIR}/${folder}"
	sdkman_cleanup_disk_usage=$(du -sh "$sdkman_cleanup_dir")
	sdkman_cleanup_count=$(ls -1 "$sdkman_cleanup_dir" | wc -l)

	rm -rf "${SDKMAN_DIR}/${folder}"
	mkdir "${SDKMAN_DIR}/${folder}"<commit_msg>Remove obsolete version flush code branch.<commit_after>#!/usr/bin/env bash

#
#   Copyright 2017 <NAME>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#

function __sdk_flush {
	local qualifier="$1"

	case "$qualifier" in
		broadcast)
			if [[ -f "${SDKMAN_DIR}/var/broadcast_id" ]]; then
				rm "${SDKMAN_DIR}/var/broadcast_id"
				rm "${SDKMAN_DIR}/var/broadcast"
				__sdkman_echo_green "Broadcast has been flushed."
			else
				__sdkman_echo_no_colour "No prior broadcast found so not flushed."
			fi
			;;
		version)
			if [[ -f "${SDKMAN_DIR}/var/version" ]]; then
				rm "${SDKMAN_DIR}/var/version"
				__sdkman_echo_green "Version file has been flushed."
			fi
			;;
		archives)
			__sdkman_cleanup_folder "archives"
			;;
		temp)
			__sdkman_cleanup_folder "tmp"
			;;
		tmp)
			__sdkman_cleanup_folder "tmp"
			;;
		*)
			__sdkman_echo_red "Stop! Please specify what you want to flush."
			;;
	esac
}

function __sdkman_cleanup_folder {
	local folder="$1"
	sdkman_cleanup_dir="${SDKMAN_DIR}/${folder}"
	sdkman_cleanup_disk_usage=$(du -sh "$sdkman_cleanup_dir")
	sdkman_cleanup_count=$(ls -1 "$sdkman_cleanup_dir" | wc -l)

	rm -rf "${SDKMAN_DIR}/${folder}"
	mkdir "${SDKMAN_DIR}/${folder}"
{'fraction_non_alphanumeric': 0.11292633992548008, 'fraction_numerical': 0.006305531670965893, 'mean_word_length': 3.800550206327373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '751011', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1139, 'n_words': 344}