Add mist toml on init
This commit is contained in:
@@ -92,6 +92,7 @@ void init_project(Vec<String> mut args)
|
|||||||
fs::write("src/main.mist", "fn main() {\n println!(\"Hello, World!\");\n}\n").expect("Failed to create src/main.mist");
|
fs::write("src/main.mist", "fn main() {\n println!(\"Hello, World!\");\n}\n").expect("Failed to create src/main.mist");
|
||||||
}
|
}
|
||||||
inject_mist_target(is_lib);
|
inject_mist_target(is_lib);
|
||||||
|
add_mist_toml(is_lib);
|
||||||
println!("\n\x1b[34minfo\x1b[0m: Please open Cargo.toml and adjust `\x1b[35mname\x1b[0m = ` as needed, Thank you for using Mist!\n");
|
println!("\n\x1b[34minfo\x1b[0m: Please open Cargo.toml and adjust `\x1b[35mname\x1b[0m = ` as needed, Thank you for using Mist!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,3 +106,13 @@ void inject_mist_target(bool is_lib)
|
|||||||
};
|
};
|
||||||
fs::write("Cargo.toml", toml_content + inject).expect("Failed to inject to Cargo.toml");
|
fs::write("Cargo.toml", toml_content + inject).expect("Failed to inject to Cargo.toml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void add_mist_toml(bool is_lib)
|
||||||
|
{
|
||||||
|
str& content = if is_lib {
|
||||||
|
"package = \"lib.mist\"\npackages = []\ninclude = []\n"
|
||||||
|
} else {
|
||||||
|
"package = \"main.mist\"\npackages = []\ninclude = []\n"
|
||||||
|
};
|
||||||
|
fs::write("Mist.toml", content).expect("Failed to add Mist.toml");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user