fix: Start walking from executable directory, not file path
The previous fix started walking from the executable file itself, but we need to start from its parent directory. Changed: let mut current = exe_path.as_path(); to: let mut current = exe_path.parent().unwrap_or_else(|| exe_path.as_path()); This ensures we check directories, not the file itself. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
+2
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user