summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2010-12-15 18:27:09 -0800
committerRyan Davis <ryand@zenspider.com>2010-12-15 18:27:09 -0800
commite7ee8061a6fb08148ae954f49ad335f8bc1dc0ad (patch)
tree2336f22d69b43d4a1811af20f758bf49137e1243 /bin
parent9ec8a6eb13b0d79e79d4cf72c993a4aa8ef38057 (diff)
downloadhoe-e7ee8061a6fb08148ae954f49ad335f8bc1dc0ad.tar.gz
+ Clean up sow a LOT using: include FileUtils::Verbose
[git-p4: depot-paths = "//src/hoe/dev/": change = 6083]
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sow20
1 files changed, 11 insertions, 9 deletions
diff --git a/bin/sow b/bin/sow
index c723e0d..3cb98fd 100755
--- a/bin/sow
+++ b/bin/sow
@@ -16,6 +16,8 @@ if $h || ARGV.empty? || ($t && $d) then
exit
end
+include FileUtils::Verbose
+
project = ARGV.shift
abort "Project #{project} seems to exist" if test ?d, project
@@ -28,19 +30,19 @@ source_path = File.join(File.dirname(File.dirname(__FILE__)),
"template")
unless File.directory? template_path then
- FileUtils.cp_r source_path, template_path, :verbose => true
+ FileUtils.cp_r source_path, template_path
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
+ FileUtils.chmod 0644, paths
+ FileUtils.chmod 0755, paths.grep(/bin\//)
end
-FileUtils.cp_r template_path, project, :verbose => true
+FileUtils.cp_r template_path, project
Dir.chdir project do
dirs = Dir["**/*"].select { |f| File.directory? f }.sort.reverse
dirs.grep(/file_name$/).each do |file|
- FileUtils.mv file, file.sub(/file_name$/, file_name), :verbose => true
+ FileUtils.mv file, file.sub(/file_name$/, file_name)
end
paths = (Dir["**/*"] + Dir["**/.*"]).select { |f| File.file? f }.sort
@@ -56,15 +58,15 @@ Dir.chdir project do
paths.grep(/file_name|\.erb$/).each do |file|
new_file = file.sub(/file_name/, file_name).sub(/\.erb$/, '')
- FileUtils.mv file, new_file, :verbose => true
+ FileUtils.mv file, new_file
end
end
if $d || $t then
temp_dir = "#{project}.#{$$}"
- FileUtils.mv project, temp_dir, :verbose => true
- FileUtils.mkdir project, :verbose => true
- FileUtils.mv temp_dir, "#{project}/#{$d ? 'dev' : 'trunk'}", :verbose => true
+ FileUtils.mv project, temp_dir
+ FileUtils.mkdir project
+ FileUtils.mv temp_dir, "#{project}/#{$d ? 'dev' : 'trunk'}"
end
puts