Skip to content

Commit bec04a3

Browse files
committed
* Enable to specify branch by "#" in REPO.
1 parent 66edbc2 commit bec04a3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
11+
* Enable to specify branch by "#" in REPO
12+
* e.g. REPO="https://github.com/user/mt-plugin-XXX.git#main"
13+
914
## [1.0.3] - 2020-10-22
1015

1116
### Added

bin/setup-environment

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,13 @@ for my $r ( split /\s+/, $repos ) {
180180

181181
# get repo
182182
if ( !-d $directory ) {
183+
my $branch = '';
184+
$branch = $1 if $r =~ s/(?:#(\w+))\z//;
185+
183186
my $k = basename($r);
184187
$directory = catfile( $repo_base_dir, $k );
185188

186-
my $cmd = "$git_clone_cmd $r $directory";
189+
my $cmd = "$git_clone_cmd $r $directory $branch";
187190
my $res = `$cmd 2>&1` || "";
188191
die "$res\nGot an error: $cmd" if $?;
189192

0 commit comments

Comments
 (0)