Skip to content

Commit

Permalink
Merge pull request #19481 from agrare/optionally_symlink_spec_managei…
Browse files Browse the repository at this point in the history
…q_in_plugins

Optionally symlink a plugin's spec/manageiq
  • Loading branch information
Fryguy authored Nov 8, 2019
2 parents 077afc6 + e21c51f commit 2b0f2a6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/generators/manageiq/plugin/templates/bin/setup
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'

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")
manageiq_repo = Pathname.new(ENV["MANAGEIQ_REPO"])
puts "== Symlinking spec/manageiq to #{manageiq_repo}"

FileUtils.rm_rf(spec_manageiq.expand_path)
FileUtils.ln_s(manageiq_repo.expand_path, spec_manageiq.expand_path)
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 2b0f2a6

Please sign in to comment.