| | 53 | |
|---|
| | 54 | desc "Add new scripts to the application script/ directory" |
|---|
| | 55 | task :add_new_scripts do |
|---|
| | 56 | local_base = "script" |
|---|
| | 57 | edge_base = "#{File.dirname(__FILE__)}/../../bin" |
|---|
| | 58 | |
|---|
| | 59 | local = Dir["#{local_base}/**/*"].reject { |path| File.directory?(path) } |
|---|
| | 60 | edge = Dir["#{edge_base}/**/*"].reject { |path| File.directory?(path) } |
|---|
| | 61 | |
|---|
| | 62 | edge.each do |script| |
|---|
| | 63 | base_name = script[(edge_base.length+1)..-1] |
|---|
| | 64 | next if base_name == "rails" |
|---|
| | 65 | next if local.detect { |path| base_name == path[(local_base.length+1)..-1] } |
|---|
| | 66 | if !File.directory?("#{local_base}/#{File.dirname(base_name)}") |
|---|
| | 67 | mkdir_p "#{local_base}/#{File.dirname(base_name)}" |
|---|
| | 68 | end |
|---|
| | 69 | install script, "#{local_base}/#{base_name}", :mode => 0655 |
|---|
| | 70 | end |
|---|
| | 71 | end |
|---|