Targets can be paths

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

View File

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