Permalink
Browse files

Minor changes to release upload script.

  • Loading branch information...
1 parent ca5a17c commit 4e343e81d66b00e0e70ea48a23bcd7f545f9c6fb @joseph committed Sep 5, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 Rakefile
View
@@ -43,8 +43,12 @@ class MonocleDistributor
build(:minify => minified)
distribute("README.md", IO.read("README.md"))
manifest = ["scripts/", "styles/", "README.md"]
- pkg_path = File.expand_path("dist/monocle-#{pkg_type}#{release_name}.zip")
- `cd #{dist_dir} && zip -r #{pkg_path} #{manifest.join(' ')}`
+ pkg_path = "dist/monocle-#{pkg_type}#{release_name}.zip"
+ cmd = [
+ "cd #{dist_dir} && ",
+ "zip -r #{File.expand_path(pkg_path)} #{manifest.join(' ')}"
+ ]
+ `#{cmd.join}`
puts "Package: #{pkg_path}"
FileUtils.rm_rf("dist/pkg")
acc << pkg_path
@@ -59,6 +63,7 @@ class MonocleDistributor
def release_tag(tag)
if `git checkout #{tag}`
+ @tag = tag
upload_packages(package)
`git checkout master`
else
@@ -91,6 +96,7 @@ class MonocleDistributor
def release_name
+ return @tag if @tag
out = `git symbolic-ref HEAD 2>/dev/null`
if $?.success?
out.sub!(/refs\/heads\//, '').strip!
@@ -102,6 +108,9 @@ class MonocleDistributor
def upload_packages(pkgs)
+ if dep('highline', :else => "no HighLine, no prompts")
+ return unless HighLine.new.agree("Upload these packages to Github?")
+ end
pkgs.reverse.each { |pkg_path|
min = pkg_path.index('minified') ? 'minified ' : ''
upload(pkg_path, "Monocle #{min}script @ #{release_name}")
@@ -122,7 +131,7 @@ class MonocleDistributor
:description => desc
}
url = gh.replace(opts)
- puts("Wrote: #{file} -> #{CGI.unescape(url)}")
+ puts("Uploaded: #{file} -> #{CGI.unescape(url)}")
end

0 comments on commit 4e343e8

Please sign in to comment.