diff options
author | Ryan Davis <ryand@zenspider.com> | 2011-02-08 18:49:46 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2011-02-08 18:49:46 -0800 |
commit | b17c8b2017f229bb0e5af101080cdbe15037425f (patch) | |
tree | 1c4b10a326594490e624e63bd59ace081d591d6c /bin | |
parent | cf94e0c558415c253804ac2dcdf6e47742f11d3f (diff) | |
download | hoe-b17c8b2017f229bb0e5af101080cdbe15037425f.tar.gz |
- Fixed a bug with sow -d or -t
[git-p4: depot-paths = "//src/hoe/dev/": change = 6163]
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sow | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -13,7 +13,7 @@ option = { :subdir => nil, } -def check_subdir +def check_subdir option if option[:subdir] then warn "ERROR: you can't specify multiple subdirs" abort opts.to_s @@ -26,12 +26,12 @@ opts = OptionParser.new do |opts| opts.separator "Standard options:" opts.on("-t", "--trunk", "Add project to subdir under 'trunk'.") do - check_subdir + check_subdir option option[:subdir] = "trunk" end opts.on("-d", "--dev", "Add project to subdir under 'dev'.") do - check_subdir + check_subdir option option[:subdir] = "dev" end @@ -47,8 +47,6 @@ end opts.parse! -# TODO: fail if both dev and trunk - include FileUtils::Verbose # variables for erb: @@ -108,11 +106,11 @@ Dir.chdir project do end end -if option[:dev] || option[:trunk] then +if option[:subdir] then temp_dir = "#{project}.#{$$}" FileUtils.mv project, temp_dir FileUtils.mkdir project - FileUtils.mv temp_dir, "#{project}/#{option[:dev] ? 'dev' : 'trunk'}" + FileUtils.mv temp_dir, "#{project}/#{option[:subdir]}" end puts |