Skip to content

Commit

Permalink
Add 'add_new_scripts' rake task for adding new rails scripts to script/*
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2926 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Nov 7, 2005
1 parent 63e30a5 commit c2eb22e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Add 'add_new_scripts' rake task for adding new rails scripts to script/* [Jamis Buck]

* Remove bogus hyphen from script/process/reaper calls to 'ps'. #2767 [anonymous]

* Copy lighttpd.conf when it is first needed, instead of on app creation [Jamis Buck]
Expand Down
3 changes: 0 additions & 3 deletions railties/bin/lighttpd

This file was deleted.

19 changes: 19 additions & 0 deletions railties/lib/tasks/framework.rake
Expand Up @@ -50,3 +50,22 @@ desc "Unlock this application from freeze of gems or edge and return to a fluid
task :unfreeze_rails do
rm_rf "vendor/rails"
end

desc "Add new scripts to the application script/ directory"
task :add_new_scripts do
local_base = "script"
edge_base = "#{File.dirname(__FILE__)}/../../bin"

local = Dir["#{local_base}/**/*"].reject { |path| File.directory?(path) }
edge = Dir["#{edge_base}/**/*"].reject { |path| File.directory?(path) }

edge.each do |script|
base_name = script[(edge_base.length+1)..-1]
next if base_name == "rails"
next if local.detect { |path| base_name == path[(local_base.length+1)..-1] }
if !File.directory?("#{local_base}/#{File.dirname(base_name)}")
mkdir_p "#{local_base}/#{File.dirname(base_name)}"
end
install script, "#{local_base}/#{base_name}", :mode => 0655
end
end

0 comments on commit c2eb22e

Please sign in to comment.