diff options
author | Ryan Davis <ryand@zenspider.com> | 2009-02-18 03:20:52 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2009-02-18 03:20:52 -0800 |
commit | d508c85aca4c0380dd3578617362590d85a7fe5b (patch) | |
tree | 0c58c33470b92ac1aa93c3cb57ab83e1f2612513 | |
parent | 0d7810f32d3c09fd6b3635859b568680867898f6 (diff) | |
download | hoe-d508c85aca4c0380dd3578617362590d85a7fe5b.tar.gz |
Fixed perms problem when running sow from installed gem
[git-p4: depot-paths = "//src/hoe/dev/": change = 4599]
-rwxr-xr-x | bin/sow | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -19,7 +19,6 @@ end project = ARGV.shift abort "Project #{project} seems to exist" if test ?d, project -puts "creating project #{project}" # variables for erb: XIF = 'FI' + 'X' # prevents extra hits on my TAG reporter @@ -28,13 +27,18 @@ template_path = File.expand_path("~/.hoe_template") source_path = File.join(File.dirname(File.dirname(__FILE__)), "template") -FileUtils.cp_r source_path, template_path, :verbose => true unless - File.directory? template_path +unless File.directory? template_path then + FileUtils.cp_r source_path, template_path, :verbose => true + paths = (Dir["#{template_path}/**/*"] + + Dir["#{template_path}/**/.*"]).select { |f| File.file? f } + FileUtils.chmod 0644, paths, :verbose => true + FileUtils.chmod 0755, paths.grep(/bin\//), :verbose => true +end FileUtils.cp_r template_path, project, :verbose => true Dir.chdir project do - paths = (Dir["**/?*"] + Dir["**/.*"]).select { |f| File.file? f }.sort + paths = (Dir["**/*"] + Dir["**/.*"]).select { |f| File.file? f }.sort paths.each do |path| file = File.read path |