dbg_msg $app "error" "Base 16 Pattern not correctly recognized in file: $alacritty_conf. Please make sure pattern begins with # Base 16 and ends with # Base 16end and only exists once in the file. No changes to file made."
elif [[ -z "$startline" && -z "$endline" ]]; then
# TODO on first run automatically replace ^colors: line and any subsequent indented lines with commented versions and create colors: *colorscheme programatically
dbg_msg $app "warn" "No previous Base16 pattern found in file: $alacritty_conf. If this is your first time running the processor, please manually remove any previous colors: settings and replace with 'colors: *colorscheme' instead."
cat "$alacritty_conf" >"$tmpfile" || exit 1
else
# remove old lines of any base16 theme
sed -e "$startline,$endline d" "$alacritty_conf" >"$tmpfile" || exit 1
fi
# make sure we're not adding this line twice
sed -e 's/^draw_bold_text_with_bright_colors:/# draw_bold_text_with_bright_colors:/' "$tmpfile" >"$tmpfile.tmp"
mv "$tmpfile.tmp" "$tmpfile"
# fix template theme name key for easier inclusion
sed -e "s/^colors:/$theme: \&colorscheme/" "$tfile" >"$tmptheme" || exit 1
echo "# Base16End $theme - alacritty color config" >>"$tmptheme"
# combine both into final config file
# replace original file with new colorscheme-added version