mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-22 03:19:36 +00:00
docs: add and clean up AI-generated rustdoc comments (grok-4.5)
This commit is contained in:
@@ -18,10 +18,14 @@
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
// creating git init and .gitignore
|
||||
/// Initializes a Git repository in the target directory and configures its `.gitignore` file.
|
||||
///
|
||||
/// Executes `git init` via the VCS utility module, creates a default `.gitignore` if none exists,
|
||||
/// or updates an existing `.gitignore` to ensure `.dcr/` and build outputs are ignored.
|
||||
pub fn init(path: &Path) -> Result<(), String> {
|
||||
crate::utils::git::git_init(path)?;
|
||||
|
||||
// Populate default .gitignore entries or append DCR metadata rules.
|
||||
let gitignore_path = path.join(".gitignore");
|
||||
if !gitignore_path.exists() {
|
||||
fs::write(&gitignore_path, "/target\n.dcr/\n")
|
||||
|
||||
Reference in New Issue
Block a user