From 74bcd6a71ddb2b6fe439c3d5763eb727b7bba324 Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 12 Jan 2026 12:09:07 +0200 Subject: [PATCH] fix: only try to cd into scripts dir if it exists #531 --- modules/script/v2/script.nu | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/script/v2/script.nu b/modules/script/v2/script.nu index fb008a0f..5fa3fbdd 100644 --- a/modules/script/v2/script.nu +++ b/modules/script/v2/script.nu @@ -7,9 +7,12 @@ def main [config: string]: nothing -> nothing { | default [] snippets let script_dir = [$env.CONFIG_DIRECTORY scripts] | path join - cd $script_dir - glob ./**/*{.sh,.nu,.py} - | each { chmod +x $in } + if ($script_dir | path exists) { + cd $script_dir + glob ./**/*{.sh,.nu,.py} | each { chmod +x $in } + } else { + print $'(ansi yellow)Script directory not found, skipping...(ansi reset)' + } $config.scripts | each {|script|