add support of sketch flag

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-26 23:47:00 +03:00
parent 223efa9182
commit 7f0bd993d2
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

10
wd2
View file

@ -48,7 +48,7 @@ function parse_args() {
}
function get_attr_value() {
head -n3 "$d2_input_file" | grep "$1" | awk -F"$1: " '{ print $2 }' | cut -d';' -f1
head -n4 "$d2_input_file" | grep "$1" | awk -F"$1: " '{ print $2 }' | cut -d';' -f1
}
parse_args "$@"
@ -62,10 +62,12 @@ set +e
d2_layout=$(get_attr_value "layout")
d2_theme=$(get_attr_value "theme")
d2_pad=$(get_attr_value "pad")
d2_sketch=$(get_attr_value "sketch")
set -e
d2 "${d2_args[@]}" \
${d2_layout:+--layout ${d2_layout}} \
${d2_theme:+--theme ${d2_theme}} \
${d2_pad:+--pad ${d2_pad}}
${d2_layout:+--layout=${d2_layout}} \
${d2_theme:+--theme=${d2_theme}} \
${d2_pad:+--pad=${d2_pad}} \
${d2_sketch:+--sketch=${d2_sketch}}