Sha256: c8781f56e9f1e0dec06187aa9c8a2de85380fa1330c22d2d2724e5f4b1758eae

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

#!/usr/bin/env ruby

require "fileutils"
require "facter"
require "tmpdir"

# tmpdirディレクトリにコピー
dir = File.dirname(File.expand_path(__FILE__ + "/../"))
home_dir = ENV["HOME"] + "/" + dir.split("/")[-1]
puts "home_dir=#{$home_dir}"
Dir.mktmpdir { |tmpdir|
  outdir = tmpdir + "/" + dir.split("/")[-1]
  FileUtils.mkdir_p outdir
  FileUtils.mkdir_p home_dir
  puts outdir
  Dir.glob("#{dir}/lib/*") do |f|
    if f =~ /config$/
      # configはhomeにコピー
      if !File.exists? "#{home_dir}/config"
        puts "#{f} => #{home_dir}/"
        FileUtils.cp_r f, "#{home_dir}/"
      end
    else
      puts "#{f} => #{outdir}/"
      FileUtils.cp_r f, "#{outdir}/"
    end
  end

  FileUtils.cd "#{outdir}"
  kernel = Facter.value(:kernel)
  if kernel == "windows"
    system "rubyw ./start.rb"
  elsif kernel == "Linux"
    system "ruby ./start.rb"
  else
    system "ruby ./start.rb"
  end
  FileUtils.cd ENV["HOME"]
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
browser_app_base-0.1.3 bin/start_sample.rb
browser_app_base-0.1.2 bin/start_sample.rb