storkit: merge 371_bug_no_arg_storkit_in_empty_directory_skips_scaffold
This commit is contained in:
@@ -177,13 +177,19 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
config::ProjectConfig::load(&project_root)
|
||||
.unwrap_or_else(|e| panic!("Invalid project.toml: {e}"));
|
||||
} else {
|
||||
// No .storkit/ found — fall back to cwd so existing behaviour is preserved.
|
||||
// TRACE:MERGE-DEBUG — remove once root cause is found
|
||||
slog!(
|
||||
"[MERGE-DEBUG] main: no .storkit/ found, falling back to cwd {:?}",
|
||||
cwd
|
||||
);
|
||||
*app_state.project_root.lock().unwrap() = Some(cwd.clone());
|
||||
// No .storkit/ found in cwd or parents — scaffold cwd as a new
|
||||
// project, exactly like `storkit .` does.
|
||||
io::fs::open_project(
|
||||
cwd.to_string_lossy().to_string(),
|
||||
&app_state,
|
||||
store.as_ref(),
|
||||
port,
|
||||
)
|
||||
.await
|
||||
.unwrap_or_else(|e| {
|
||||
slog!("Warning: failed to scaffold project at {cwd:?}: {e}");
|
||||
cwd.to_string_lossy().to_string()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user