Skip to content

Commit 9c5d86b

Browse files
committed
- Update rush clone to set default repo if it is the only one
1 parent c238dcf commit 9c5d86b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

rush

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,11 +1488,16 @@ rush_clone_command() {
14881488
ignore=${args[--ignore]}
14891489
default_repo_name=${repo_id%%/*}
14901490
default=${args[--default]}
1491+
explicit_name=${args[--name]}
14911492

14921493
if [[ $default ]]; then
14931494
repo_name=default
1495+
elif [[ $explicit_name ]]; then
1496+
repo_name=$explicit_name
1497+
elif [[ -z "$(config_keys)" ]]; then
1498+
repo_name=default
14941499
else
1495-
repo_name=${args[--name]:-$default_repo_name}
1500+
repo_name=$default_repo_name
14961501
fi
14971502

14981503
[[ $repo_id = */* ]] || repo_id="$repo_id/rush-repo"

src/commands/clone.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ shallow=${args[--shallow]}
66
ignore=${args[--ignore]}
77
default_repo_name=${repo_id%%/*}
88
default=${args[--default]}
9+
explicit_name=${args[--name]}
910

1011
if [[ $default ]]; then
1112
repo_name=default
13+
elif [[ $explicit_name ]]; then
14+
repo_name=$explicit_name
15+
elif [[ -z "$(config_keys)" ]]; then
16+
repo_name=default
1217
else
13-
repo_name=${args[--name]:-$default_repo_name}
18+
repo_name=$default_repo_name
1419
fi
1520

1621
## Adjust repo_id - defaults to $user/rush-repo

0 commit comments

Comments
 (0)