Skip to content

Clone rspec-metagem correctly #2737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Gemfile-rspec-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp
if File.exist?(library_path) && !ENV['USE_GIT_REPOS']
gem lib, :path => library_path, :require => false
else
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch, :require => false
if lib == 'rspec'
gem 'rspec', :git => "https://github.com/rspec/rspec-metagem.git", :branch => branch, :require => false
else
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch, :require => false
end
end
end
2 changes: 1 addition & 1 deletion script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source script/functions.sh

pushd ..

clone_repo "rspec"
clone_repo "rspec-metagem" "rspec"
clone_repo "rspec-core"
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"
Expand Down
10 changes: 8 additions & 2 deletions script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ function documentation_enforced {
}

function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH"
if [ -z "$2" ]; then
DIR_TARGET="$1"
else
DIR_TARGET="$2"
fi

if [ ! -d $DIR_TARGET ]; then # don't clone if the dir is already there
ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH $DIR_TARGET"
fi;
}

Expand Down