<commit_before>#!/bin/bash
hostname=$1
config_file='generated/default.conf'

echo "Creating config for $hostname"

function ask_attribute {
  echo "Set value of $1:"
  echo -n "$1="
  read value
  echo
  eval "$1='$value'"
}

ask_attribute 'public_folder'

mkdir -p 'generated'
echo '' > "$config_file" # clear previous file

while read line
do
    eval echo "$line" >> "$config_file"
done < "templates/default.tmpl.conf"

echo "Config file created!"<commit_msg>fixed templating<commit_after>#!/bin/bash
hostname=$1

function ask_attribute {
  echo "Set value of $1:"
  echo -n "$1="
  read value
  echo
  eval "$1='$value'"
}

function render {
  while read -r line
  do
    line=${line//\"/\\\"}
    line=${line//\`/\\\`}
    line=${line//\$/\\\$}
    line=${line//\\\${/\${}
    eval "echo \"$line\"" >> "$config_file"
  done < "$1"
}


echo "Creating config for $hostname"

ask_attribute 'public_folder' # get value and create "public_folder"

config_file='generated/default.conf'
mkdir -p 'generated'
echo '' > "$config_file" # clear previous file

render "templates/default.tmpl.conf"

echo "Config file created!"
{'fraction_non_alphanumeric': 0.1742627345844504, 'fraction_numerical': 0.00804289544235925, 'mean_word_length': 3.7058823529411766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '447224', 'n_tokens_mistral': 396, 'n_tokens_neox': 387, 'n_words': 108}