Fix Pallet Init #23

Merged
sfrembling merged 4 commits from working/#22 into main 2026-03-23 15:30:47 -06:00
Showing only changes of commit 1974ed90be - Show all commits

View File

@@ -330,7 +330,19 @@ fn create_project<P: AsRef<Path>>(directory: P) -> std::io::Result<()> {
std::fs::write("src/main.c", MAIN_C)?;
std::fs::write(".gitignore", GITIGNORE)?;
let config = crate::config::Config::new(&pathdir.to_string_lossy());
let lossy = pathdir.to_string_lossy();
let app_name = if lossy == "." {
let root = std::env::current_dir()?;
root.file_name()
.expect("a valid file name")
.to_string_lossy()
.to_string()
} else {
lossy.to_string()
};
let config = crate::config::Config::new(&app_name);
let serial = toml::to_string_pretty(&config).expect("a valid TOML structure");