Fix worktree initialization

This commit is contained in:
2022-01-24 17:24:24 +01:00
parent 881a33dc96
commit f2f1d5bcaf
3 changed files with 28 additions and 6 deletions

View File

@@ -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)]

View File

@@ -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)