Skip to content

Commit

Permalink
Optionally symlink a plugin's spec/manageiq
Browse files Browse the repository at this point in the history
Add the option to symlink a plugin's spec/manageiq instead of a shallow
clone, allowing for local repositories to be linked together to test
groups of changes.
  • Loading branch information
agrare committed Nov 7, 2019
1 parent 077afc6 commit d330e4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/generators/manageiq/plugin/templates/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
require 'pathname'

gem_root = Pathname.new(__dir__).join("..")
spec_manageiq = gem_root.join("spec/manageiq")

unless gem_root.join("spec/manageiq").exist?
if ENV.key?("MANAGEIQ_REPO")
puts "== Symlinking spec/manageiq to #{ENV["MANAGEIQ_REPO"]}"

spec_manageiq.rmtree if spec_manageiq.exist?
system "ln -fs #{ENV["MANAGEIQ_REPO"]} spec/manageiq"
elsif !spec_manageiq.exist?
puts "== Cloning manageiq sample app =="
system "git clone https://github.com/ManageIQ/manageiq.git --branch master --depth 1 spec/manageiq"
end
Expand Down

0 comments on commit d330e4b

Please sign in to comment.