Targets can be paths

This commit is contained in:
Dakedres 2024-03-22 09:32:54 -06:00
parent 2307b5c56d
commit 2596c2c5e1

@ -60,10 +60,14 @@ check_scheme_path() {
}
parse_format() {
if [ -z "$format" ]; then
format=$scheme_format
if [ -r "$format" ]; then
format_dir="$format"
else
if [ -z "$format" ]; then
format=$scheme_format
fi
format_dir="${shchemes_dir}/${format}"
fi
format_dir="${shchemes_dir}/${format}"
}
parse_comment_pattern() {
@ -103,10 +107,14 @@ create_theme() {
parse_format
if [ -n "$target" ]; then
template_path=${format_dir}/templates/${target}.mustache
if [ ! -r "$template_path" ]; then
echo "No viable ${scheme_format} template for \"${target}\""
exit 1
if [ -r "$target" ]; then
template_path="$target"
else
template_path=${format_dir}/templates/${target}.mustache
if [ ! -r "$template_path" ]; then
echo "No viable ${scheme_format} template for \"${target}\""
exit 1
fi
fi
fi