From 2596c2c5e1a9c8a23e65f47d05221444254695e8 Mon Sep 17 00:00:00 2001 From: Dakedres Date: Fri, 22 Mar 2024 09:32:54 -0600 Subject: [PATCH] Targets can be paths --- shchemes | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/shchemes b/shchemes index 146c96c..111ea21 100755 --- a/shchemes +++ b/shchemes @@ -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