1769192795
This commit is contained in:
@@ -22,7 +22,6 @@ def main [subject: string, shortcode: string, number?: int] {
|
||||
let subject_dir = $"($out_dir)/($subject_lower)"
|
||||
|
||||
# TODO?: replace with git clone
|
||||
# copy-template $temp_dir
|
||||
$template | decode base64 | tar zxvf - --strip-components=1 -C $temp_dir o> (std null-device)
|
||||
generate-doc-toml $shortcode_lower $subject_lower $temp_dir $number
|
||||
|
||||
@@ -42,17 +41,17 @@ def main [subject: string, shortcode: string, number?: int] {
|
||||
|
||||
def validate-input [subject: string, shortcode: string, number?: int] {
|
||||
if not ($config_dir | path exists) {
|
||||
error make -u {msg: "Config directory not found"}
|
||||
error make -u {msg: $"($config_dir) not found"}
|
||||
}
|
||||
|
||||
let defaults_toml = $"($config_dir)/defaults.toml"
|
||||
let subjects_toml = $"($config_dir)/subjects.toml"
|
||||
|
||||
if not ($defaults_toml | path exists) {
|
||||
error make -u {msg: $"defaults.toml not found in config directory"}
|
||||
error make -u {msg: $"defaults.toml not found in ($config_dir)"}
|
||||
}
|
||||
if not ($subjects_toml | path exists) {
|
||||
error make -u {msg: "subjects.toml not found in config directory"}
|
||||
error make -u {msg: $"subjects.toml not found in ($config_dir)"}
|
||||
}
|
||||
|
||||
if ($number != nothing and $number < 1 ) {
|
||||
@@ -70,14 +69,6 @@ def validate-input [subject: string, shortcode: string, number?: int] {
|
||||
}
|
||||
}
|
||||
|
||||
def copy-template [target_dir: string] {
|
||||
if not ($template_dir | path exists) {
|
||||
error make -u {msg: $"Template directory ($template_dir) not found"}
|
||||
}
|
||||
|
||||
cd $template_dir
|
||||
cp -r * $target_dir
|
||||
}
|
||||
|
||||
def generate-doc-toml [shortcode: string, subject: string, target_dir: string, number?: int] {
|
||||
let defaults = (open $"($config_dir)/defaults.toml")
|
||||
|
||||
Reference in New Issue
Block a user