From 620f3ac10b368f9ffe255cfe420ab0c4f6b91a58 Mon Sep 17 00:00:00 2001 From: Henrique Alves Date: Thu, 20 Apr 2023 13:45:18 -0300 Subject: update commands --- src/main.rs | 73 ++++++++++++++++++------------------------------------------- 1 file changed, 21 insertions(+), 52 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index cad56d5..8119315 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,10 +11,6 @@ struct Cli { verbose: bool, } -// TODO: COMMANDS BROKE -// TODO: ADD https://github.com/termapps/enquirer https://docs.rs/dialoguer/latest/dialoguer/ -// TODO: ADD MULTIPLE TARGET / SOURCE FOLDERS PER REPOSITORY - #[derive(Subcommand)] enum Commands { /// Initialize Godot project for GLAM @@ -26,30 +22,13 @@ enum Commands { git_repo: String, }, - /// Install all packages on .glam file - Install { - /// Don't copy to target folder - #[clap(short, long, required = false, takes_value = false)] - no_copy: bool, - }, - - /// Update a single repository. If no repository name is provided, update all repositories - Update { - /// Name of the package to update (default is all packages) - package_name: String, - /// Don't copy to target folder - #[clap(short, long, required = false, takes_value = false)] - no_copy: bool, - }, + /// Update a repository + Update {}, - /// Apply changes to a repository - Apply { - /// Names of the package to apply changes to - package_names: Vec, - /// Create new package from the specified addon folder (will create a git repo) - #[clap(short, long, required = false, default_value = "")] - create_from_addon: String, - }, + /// Install all addons on glam file + Install {}, + // Apply changes to a repository + //Apply {}, } fn main() { @@ -62,42 +41,32 @@ fn main() { commands::initialize(&root); } - Commands::Add { - git_repo, - } => { + Commands::Add { git_repo } => { let root = commands::search_project_root(); if commands::check_initialization(&root) { commands::add_repository(&root, git_repo, cli.verbose); } } - Commands::Install { no_copy } => { + Commands::Update {} => { let root = commands::search_project_root(); if commands::check_initialization(&root) { - commands::install_repositories(&root, cli.verbose, !*no_copy); + commands::update_repository(&root, cli.verbose); } - } - - Commands::Update { - no_copy, - package_name, - } => { + } + + Commands::Install {} => { let root = commands::search_project_root(); if commands::check_initialization(&root) { - commands::update_repositories(&root, cli.verbose, !*no_copy); + commands::install_repositories(&root, cli.verbose); } - } - - Commands::Apply { - package_names, - create_from_addon, - } => { - let root = commands::search_project_root(); - if commands::check_initialization(&root) { - for package_name in package_names { - commands::apply_changes(&root, &package_name, &create_from_addon, cli.verbose); - } - } - } + } + + /*Commands::Apply {} => { + let root = commands::search_project_root(); + if commands::check_initialization(&root) { + commands::apply_changes(&root, cli.verbose); + } + }*/ } } -- cgit v1.2.3