Closed miaomiaowu0428 closed 3 months ago
The recent updates to the zino-cli
project introduce a new new
subcommand for creating projects using templates and extend the existing init
subcommand to support template-based initialization. Dependencies for handling file operations (walkdir
) and Git repositories (git2
) have been added. These changes enhance the user experience by automating project setup and ensuring cleaner initialization processes.
File(s) | Summary |
---|---|
zino-cli/Cargo.toml |
Added dependencies: walkdir (v2.5.0), git2 (v0.19.0), and zino (v0.23.1) with "axum" features. |
zino-cli/src/cli/init.rs |
Enhanced Init struct with optional template and project_name fields. Updated run method for template initialization and cleanup. Added init_with_template method. |
zino-cli/src/cli/mod.rs |
Added imports and modules for new functionalities, including template processing and directory cleaning. Renamed Subcomands to Subcommands . Added New variant to Subcommands . |
zino-cli/src/cli/new.rs |
Introduced New struct for the new subcommand, including methods for running the command and handling project template creation. |
zino-cli/src/main.rs |
Updated match block to include the New subcommand and replaced log::error! with println! for error handling. |
sequenceDiagram
participant User
participant CLI as zino-cli
participant FS as File System
participant Git as Git Service
User->>CLI: zino-cli new <project_name> [--template <template_url>]
CLI->>FS: Check if project directory exists
FS-->>CLI: Directory status
CLI->>Git: Clone template repository (if template URL provided)
Git-->>CLI: Template files
CLI->>FS: Initialize project with template files
CLI->>User: Project created successfully
In the land of code where projects sprout,
zino-cli
helps without a doubt.
From templates pristine to projects new,
It simplifies with a click or two.
Dependencies added, errors cleaned,
With every change, our tools are keen.
So hail the code, let's celebrate,
Forzino-cli
is truly great!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Add tow subcommands for zino-cli: new: creat a new project in the specified directory. init: creat a project in the current directory.
Summary by CodeRabbit
New Features
template
andproject_name
in project initialization.Enhancements
Bug Fixes