Skip to content

Conversation

@Nero5023
Copy link
Contributor

Add install guiding if buck2 is not available.
It will show installing options for user
image

Also this pr add config file support for custom buck2 binary path. It is useful for us, since our buck2 is little different

- Add `ensure_buck2_installed` function to verify Buck2 installation across multiple commands.
- Enhanced user prompts with colored output for better visibility and user experience.
- Updated `Cargo.toml` and `Cargo.lock` to include the `colored` dependency for terminal output styling.
- Added a selection prompt for users to choose between automatic installation and manual guidance.
- Updated `Cargo.toml` to include the `inquire` dependency for interactive prompts.
- Integrated configuration loading from `~/.config/buckal/config.toml`
- Added `toml` dependency to `Cargo.toml` for configuration file parsing.
@genedna genedna requested a review from Copilot August 29, 2025 06:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Buck2 installation guidance and configuration support for custom Buck2 binary paths. It introduces an interactive installation flow that prompts users when Buck2 is not available and adds configuration file support for specifying custom Buck2 binary locations.

Key changes:

  • Interactive Buck2 installation flow with automatic and manual options
  • Configuration system for custom Buck2 binary paths via ~/.config/buckal/config.toml
  • Centralized Buck2 command execution through a new Buck2Command abstraction

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils.rs Adds Buck2 installation checking, prompting, and automatic installation functions
src/buck2.rs New Buck2 command abstraction that supports custom binary paths from config
src/config.rs Configuration system for loading custom Buck2 binary paths
src/commands/*.rs Updated all command files to use Buck2Command and ensure Buck2 is installed
src/main.rs Added new module declarations for buck2 and config
README.md Added configuration documentation
Cargo.toml Added dependencies for colored output, user prompts, and TOML parsing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


/// Get the configuration file path
pub fn config_path() -> PathBuf {
let home = std::env::var("HOME").unwrap_or_else(|_| ".".to_string());
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the HOME environment variable is Unix-specific and will not work on Windows. Consider using dirs::config_dir() or std::env::var('USERPROFILE') for cross-platform compatibility.

Copilot uses AI. Check for mistakes.
@genedna genedna merged commit a18e39d into buck2hub:main Aug 29, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants