diff --git a/README.md b/README.md index d7eee43..994b9e5 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,6 @@ Installs a bunch of scripts into the `scripts` directory of your project: * `hooks/pre-commit`, one of the hooks the prior script installs * `initialize-environment`, which bootstraps your local environment so you can get up and running -## initialize-environment - -It will also try to run `rake bootstrap`, so add a `:bootstrap` task for things that should happen when you start going -(make databases, other stuff, etc, whatever). This won't run if the `:bootstrap` task is not there. - ## Gemfile.erb?! Yeah, it's a `Gemfile` with ERB in it: @@ -43,6 +38,15 @@ It then runs `bundle install`. You can also run `penchant gemfile ENV`. +## initialize-environment + +Get new developers up to speed fast! `script/initialize-environment` does the following when run: + +* Check out any remote repos found in `Gemfile.erb` to the same directory where your current project lives. + That way, you can have your `Gemfile.erb` set up as above and everything works cleanly. +* Runs `script/gemfile remote` to set your project to using remote repositories. +* Runs `rake bootstrap` for the project if it exists. + ### After-`gemfile` hooks? Drop a file called `.penchant` in your project directory. It'll get executed every time you switch environments using diff --git a/template/script/initialize-environment b/template/script/initialize-environment index 222c8f1..dad92b2 100755 --- a/template/script/initialize-environment +++ b/template/script/initialize-environment @@ -5,7 +5,7 @@ if File.file?('Gemfile.erb') Dir.chdir '..' do File.readlines(File.join(pwd, 'Gemfile.erb')).find_all { |line| line[':git'] }.each do |line| - repo = line[%r{:git => (['"])(.*)\1}, 2] + repo = line[%r{:git => (['"])([^'"]+)\1}, 2] puts "Installing #{repo}" system %{git clone #{repo}}