Fix worktree initialization
This commit is contained in:
@@ -170,6 +170,17 @@ pub struct Config {
|
||||
help = "Path to the configuration file"
|
||||
)]
|
||||
pub config: String,
|
||||
|
||||
#[clap(
|
||||
long,
|
||||
help = "Check out the default worktree after clone",
|
||||
possible_values = &["true", "false"],
|
||||
default_value = "true",
|
||||
default_missing_value = "true",
|
||||
min_values = 0,
|
||||
max_values = 1,
|
||||
)]
|
||||
pub init_worktree: String,
|
||||
}
|
||||
|
||||
pub type RemoteProvider = grm::provider::RemoteProvider;
|
||||
@@ -224,6 +235,17 @@ pub struct SyncRemoteArgs {
|
||||
|
||||
#[clap(long, help = "Base URL for the API")]
|
||||
pub api_url: Option<String>,
|
||||
|
||||
#[clap(
|
||||
long,
|
||||
help = "Check out the default worktree after clone",
|
||||
possible_values = &["true", "false"],
|
||||
default_value = "true",
|
||||
default_missing_value = "true",
|
||||
min_values = 0,
|
||||
max_values = 1,
|
||||
)]
|
||||
pub init_worktree: String,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
|
||||
@@ -23,7 +23,7 @@ fn main() {
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
match grm::sync_trees(config) {
|
||||
match grm::sync_trees(config, args.init_worktree == "true") {
|
||||
Ok(success) => {
|
||||
if !success {
|
||||
process::exit(1)
|
||||
@@ -93,7 +93,7 @@ fn main() {
|
||||
|
||||
let config = config::Config::from_trees(trees);
|
||||
|
||||
match grm::sync_trees(config) {
|
||||
match grm::sync_trees(config, args.init_worktree == "true") {
|
||||
Ok(success) => {
|
||||
if !success {
|
||||
process::exit(1)
|
||||
|
||||
Reference in New Issue
Block a user