Sha256: c9b9575c7c5e71e13d577a05d434edf4a5d291362562680659eb8b4d0d78e640

Contents?: true

Size: 1.2 KB

Versions: 18

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env ruby

# Exit cleanly from an early interrupt
Signal.trap("INT") { exit 1 }

# Stdout/stderr should not buffer output
$stdout.sync = true
$stderr.sync = true

require 'thor/error'
require 'kameleon'

# Force Thor to raise exceptions so we can exit non-zero.
ENV["THOR_DEBUG"] = "1"

begin
  Kameleon.init_userconf
  Kameleon::Main.start
rescue Exception  => e
  Kameleon.ui.error("Error : #{e}")
  if Kameleon.env.debug
    raise e
  else
    begin
      raise e
    rescue Kameleon::Exit => e
      exit e.status_code
    rescue Kameleon::Error => e
      Kameleon.ui.trace(e)
      exit e.status_code
    rescue Thor::UndefinedTaskError => e
      Kameleon.ui.trace(e)
      exit 15
    rescue Thor::Error => e
      Kameleon.ui.trace(e)
      exit 15
    rescue SystemExit, Interrupt => e
      Kameleon.ui.error("Quitting...")
      exit 1
    rescue Errno::ENOENT => e
      Kameleon.ui.trace(e)
      exit 16
    rescue Psych::SyntaxError => e
      Kameleon.ui.trace(e)
      exit 17
    rescue Exception => e
      msg = "Unfortunately, a fatal error has occurred : "\
              "#{e.message}.\nUse --debug option for more details\n"
        Kameleon.ui.error(msg)
      exit 666
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
kameleon-builder-2.10.2 bin/kameleon
kameleon-builder-2.10.1 bin/kameleon
kameleon-builder-2.9.4 bin/kameleon
kameleon-builder-2.9.2 bin/kameleon
kameleon-builder-2.9.1 bin/kameleon
kameleon-builder-2.9.0 bin/kameleon
kameleon-builder-2.8.3 bin/kameleon
kameleon-builder-2.8.2 bin/kameleon
kameleon-builder-2.8.1 bin/kameleon
kameleon-builder-2.7.8 bin/kameleon
kameleon-builder-2.7.7 bin/kameleon
kameleon-builder-2.7.6 bin/kameleon
kameleon-builder-2.7.5 bin/kameleon
kameleon-builder-2.7.4 bin/kameleon
kameleon-builder-2.7.3 bin/kameleon
kameleon-builder-2.7.2 bin/kameleon
kameleon-builder-2.7.1 bin/kameleon
kameleon-builder-2.7.0 bin/kameleon