Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dadd719317
Fetching contributors…

Cannot retrieve contributors at this time

executable file 53 lines (36 sloc) 1.417 kb
#!/usr/bin/env ruby
require 'fileutils'
require 'json'
def replace_version_in(path, version)
text =
text.gsub!("{version}", version), 'w') { |f| f.write(text) }
manifest = JSON.parse('src/manifest.json'))
puts manifest["version"]
# Chrome
if system("chromium --pack-extension=src/ --pack-extension-key=cert.pem") == true "src.crx", "out/humpinator-#{manifest["version"]}.crx"
src_files = Dir.glob('src/*')
# --- Firefox
files = Dir.glob('bootstrap/firefox/*')
FileUtils.rm_rf 'temp/firefox'
FileUtils.mkdir 'temp/firefox'
FileUtils.cp_r files, 'temp/firefox'
FileUtils.cp_r src_files, 'temp/firefox/resources/extension-data'
# set version number
replace_version_in("temp/firefox/install.rdf", manifest["version"])
system("cd temp/firefox && zip -r humpinator.xpi . && cd ../..") "temp/firefox/humpinator.xpi", "out/humpinator-#{manifest["version"]}.xpi"
FileUtils.rm_rf 'temp/firefox'
# --- Opera
files = Dir.glob('bootstrap/opera/*')
FileUtils.rm_rf 'temp/opera'
FileUtils.mkdir 'temp/opera'
FileUtils.cp_r files, 'temp/opera'
# set version number
replace_version_in("temp/opera/config.xml", manifest["version"])
system("cd temp/opera && ./ && cd ../..") "temp/humpinator.oex", "out/humpinator-#{manifest["version"]}.oex"
#FileUtils.rm_rf 'temp/opera'
Jump to Line
Something went wrong with that request. Please try again.