Sha256: f88858dab6f4c441d0f3aa0e7c7ec5e97216c291c25feaf2e8354c98809cb0e1

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

require 'fileutils'

module SixUpdaterWeb
  OLDLOCATION = if defined?(TAR2RUBYSCRIPT)
		oldlocation
	else
	  ENV['BASE_PATH'] ? ENV['BASE_PATH'] : Dir.pwd
  end

  unless ENV['BASE_PATH']
    ENV['BASE_PATH'] = OLDLOCATION
  end

  SPECIAL = true
  SIX_ADMIN = true
end

case RUBY_PLATFORM
when /-mingw32$/, /-mswin32$/
	begin
	  %x[chcp]
	rescue
	  puts "WARNING: chcp was not found. If the web-client doesn't start properly, "
	  puts "Please follow these steps:"
	  puts
	  f = File.join(ENV['WINDIR'], 'system32', 'chcp.com').gsub!("/", "\\")
	  path = SixUpdaterWeb::OLDLOCATION
	  nf = File.join(path, "tools", "ruby", "bin").gsub!("/", "\\")
	  puts "Copy #{f} to #{nf}"
	  puts "And rename the copy to chcp.EXE. Then restart this program"
	  puts
	  puts "More info, at: http://dev-heaven.net/wiki/six-arma-updater/Six_Updater_Suite#Known-Issues"
	  sleep 10
	end
end

begin
  # If env var VERSION exists and is a number, and no VERSION= argument is passed, migration will likely fail.
  # move original env VERSION value to OS_VERSION, in case it's needed, and reset ENV["VERSION"].
  if not ARGV.any?{ |arg| /^VERSION=/i.match(arg) }
    ENV["OS_VERSION"] = ENV["VERSION"]
    ENV["VERSION"] = nil
  end
rescue
  puts "ERROR: #{$!}"
end

ENV["RAILS_ENV"] = "production"

require 'config/six-updater-web'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
six-updater-web-0.13.3 lib/common.rb
six-updater-web-0.13.2 lib/common.rb
six-updater-web-0.13.1 lib/common.rb