Sha256: 5d5e49fcbd359fd99e636175be41eed38b0281cf1d5bac27d3ce382b2189e90f
Contents?: true
Size: 1.5 KB
Versions: 1
Compression:
Stored size: 1.5 KB
Contents
require 'pkg-wizard/command' require 'pkg-wizard/rpm' require 'pkg-wizard/logger' require 'pkg-wizard/git' require 'tmpdir' require 'fileutils' require 'uri' module PKGWizard class InitEnv < Command registry << { :name => 'init-env', :klass => self } option :help, :short => "-h", :long => "--help", :description => "Show this message", :on => :tail, :boolean => true, :show_options => true, :exit => 0 def self.perform $stdout.sync = true cmd = InitEnv.new cmd.banner = "\nUsage: pkgwiz init-env\n\n" cmd.parse_options if `whoami`.strip.chomp != 'root' $stderr.puts 'Run this command as root.' exit 1 end if File.exist?('/etc/redhat-release') print '* Installing RHEL/Fedora requirements... ' output = `yum install -y git rpm-build rpmdevtools mock createrepo yum-utils screen` if $? != 0 $stderr.puts "Failed installing requirementes: \n#{output}" exit 1 end puts "done." elsif File.exist?('/etc/lsb-release') and \ File.read('/etc/lsb-release') =~ /DISTRIB_ID=Ubuntu/ print '* Installing Ubuntu requirements... ' output = `apt-get install -y git-core mock createrepo rpm yum screen` if $? != 0 $stderr.puts "Failed installing requirementes: \n#{output}" exit 1 end puts "done." else $stderr.puts 'unsupported distribuition' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pkg-wizard-0.1.23 | lib/pkg-wizard/commands/init_env.rb |