build.rb
def main(release)
  die('Must pass release version as first arg') if release.nil? || release.empty?
  OSES_ARCHES.each do |os, arches|
    arches.each do |arch|
      dest_dirs = [Helpers.latest_release_name, release].map{ |rel| "#{Helpers.findref_bin_repo}/#{rel}/#{os}/#{arch}" }
      cyan "Building findref v#{release} for #{os} #{arch}..."
      cyan "Running: #{docker_run(os, arch)}"
      system(docker_run(os, arch))
      fr_bin = Helpers.bin_name(os)
      fr_zip = Helpers.zip_name
      cyan "Zipping #{fr_bin} into #{fr_zip}"
      system("zip -9 #{fr_zip} #{fr_bin}")
      dest_dirs.each do |dest_dir|
        FileUtils.mkdir_p(dest_dir)
        FileUtils.cp(fr_zip, "#{dest_dir}/")
      end
      FileUtils.rm(fr_zip)
      FileUtils.rm(fr_bin)
    end
  end
  cyan 'Done!'
end
#
# Consider moving to github releases instead of a separate bin repo.
#   See: https://github.com/aktau/github-release/ for a useful tool to automate.
#   Example usage:  https://github.com/zyedidia/micro/blob/master/tools/release.sh
#
# Also consider moving to a Makefile.  See:
#   https://github.com/aktau/github-release/blob/master/Makefile and
#   https://github.com/zyedidia/micro for examples.
#
# The Micro source also has a snapcraft config to look at, as well as a brew package:
#   https://github.com/zyedidia/micro/blob/master/snapcraft.yaml
#
# Move build scripts and stuff to subdir
#
# Add config file (local in proj or global, just walk the tree up looking for it)
#
# Add option to honor git ignore file (currently excludes based on hidden files)
#
Consider moving to github releases instead of a separate bin repo.

Also consider moving to a Makefile.



Move build scripts and stuff to subdir

Add config file (local in proj or global, just walk the tree up looking for it)

Add option to honor git ignore file (currently excludes based on hidden files)
Consider moving to github releases instead of a separate bin repo . Also consider moving to a Makefile . Move build scripts and stuff to subdir Add config file ( local in proj or global just walk the tree up looking for it ) Add option to honor git ignore file ( currently excludes based on hidden files )
def main(release)
  die('Must pass release version as first arg') if release.nil? || release.empty?
  OSES_ARCHES.each do |os, arches|
    arches.each do |arch|
      dest_dirs = [Helpers.latest_release_name, release].map{ |rel| "#{Helpers.findref_bin_repo}/#{rel}/#{os}/#{arch}" }
      cyan "Building findref v#{release} for #{os} #{arch}..."
      cyan "Running: #{docker_run(os, arch)}"
      system(docker_run(os, arch))
      fr_bin = Helpers.bin_name(os)
      fr_zip = Helpers.zip_name
      cyan "Zipping #{fr_bin} into #{fr_zip}"
      system("zip -9 #{fr_zip} #{fr_bin}")
      dest_dirs.each do |dest_dir|
        FileUtils.mkdir_p(dest_dir)
        FileUtils.cp(fr_zip, "#{dest_dir}/")
      end
      FileUtils.rm(fr_zip)
      FileUtils.rm(fr_bin)
    end
  end
  cyan 'Done!'
end
def main ( release ) die ( 'Must pass release version as first arg' ) if release . nil? || release . empty? OSES_ARCHES . each do | os , arches | arches . each do | arch | dest_dirs = [ Helpers . latest_release_name , release ] . map { | rel | "#{Helpers.findref_bin_repo}/#{rel}/#{os}/#{arch}" } cyan "Building findref v#{release} for #{os} #{arch}..." cyan "Running: #{docker_run(os, arch)}" system ( docker_run ( os , arch ) ) fr_bin = Helpers . bin_name ( os ) fr_zip = Helpers . zip_name cyan "Zipping #{fr_bin} into #{fr_zip}" system ( "zip -9 #{fr_zip} #{fr_bin}" ) dest_dirs . each do | dest_dir | FileUtils . mkdir_p ( dest_dir ) FileUtils . cp ( fr_zip , "#{dest_dir}/" ) end FileUtils . rm ( fr_zip ) FileUtils . rm ( fr_bin ) end end cyan 'Done!' end
Consider moving to github releases instead of a separate bin repo.
Consider moving to github releases instead of a separate bin repo .
release