1769190225

This commit is contained in:
2026-01-23 19:43:45 +02:00
parent 24dce0011d
commit 16c94945c6

View File

@@ -20,6 +20,9 @@ def main [subject: string, shortcode: string, number?: int] {
copy-template $temp_dir
generate-doc-toml $shortcode_lower $subject_lower $temp_dir $number
if not ($out_dir | path exists) {
mkdir $out_dir
}
if ($final_dir | path exists) {
error make -u {msg: $"Directory ($final_dir) already exists"}
}
@@ -42,13 +45,12 @@ def validate-input [subject: string, shortcode: string, number?: int] {
if not ($defaults_toml | path exists) {
error make -u {msg: $"defaults.toml not found in config directory"}
}
if not ($subjects_toml | path exists) {
error make -u {msg: "subjects.toml not found in config directory"}
}
if not ($out_dir | path exists) {
mkdir $out_dir
if ($number != nothing and $number < 1 ) {
error make -u {msg: "Work number should be greater than 0"}
}
# Check subject exists (case insensitive)