diff --git a/src/config.rs b/src/config.rs index 1c52557..c6248ed 100644 --- a/src/config.rs +++ b/src/config.rs @@ -189,9 +189,9 @@ pub fn default_show_toolbar() -> bool { pub fn default_project_template() -> PathBuf { // Find the bundled template relative to the executable's location if let Ok(exe_path) = std::env::current_exe() { - // Walk up from the executable looking for templates/snowflake/cookiecutter.json + // Walk up from the executable's directory looking for templates/snowflake/cookiecutter.json // This handles various build configurations (release, debug, cargo run, installed binary) - let mut current = exe_path.as_path(); + let mut current = exe_path.parent().unwrap_or_else(|| exe_path.as_path()); loop { // Check if current/templates/snowflake/cookiecutter.json exists let candidate = current.join("templates/snowflake");