Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
use default env values based on gh-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Sep 11, 2012
1 parent cd6e35e commit 2e75a4c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Rakefile
Expand Up @@ -21,7 +21,7 @@ namespace :services do

desc "Writes a JSON config to FILE || config/services.json"
task :config => :load do
file = ENV["FILE"] || File.expand_path("../config/services.json", __FILE__)
file = ENV["FILE"] || default_services_config
services = []
Service.services.each do |svc|
services << {:name => svc.hook_name, :events => svc.default_events, :supported_events => svc.supported_events,
Expand All @@ -40,7 +40,7 @@ namespace :services do

desc "Writes Docs to DOCS"
task :docs => :load do
return unless dir = ENV['DOCS']
dir = ENV['DOCS'] || default_docs_dir
docs = Dir[File.expand_path("../docs/*", __FILE__)]
docs.each do |path|
name = File.basename(path)
Expand All @@ -55,4 +55,12 @@ namespace :services do

require 'set'
GitHubDocs = Set.new(%w(github_payload payload_data))

def default_services_config
"#{ENV['GH_SRC_DIR']}/github/config/services.json"
end

def default_docs_dir
"#{ENV['GH_SRC_DIR']}/github/app/views/edit_repositories/hooks/_{name}.erb"
end
end

0 comments on commit 2e75a4c

Please sign in to comment.