Sha256: b9fdc0afe550e8b658e306bf8fd35d3bfc52e973dcb54ba98e6f376e809b52f5

Contents?: true

Size: 913 Bytes

Versions: 3

Compression:

Stored size: 913 Bytes

Contents

#!/usr/bin/env ruby
main = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
main = File.dirname(main)
lib = File.expand_path('../lib', main)
thor = File.expand_path('../thor', main)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
$dwm_root = Gem::Specification.find_by_name('dwm').gem_dir

require 'thor'

Dir.glob(File.join(thor, '/**/*.thor')).each { |taskfile|
  load taskfile
}

if Process.uid == 0
  puts 'Error: Do not run dwm as root'
  exit 1
end

begin
  # show the generate help by default
  if ARGV[0] == "help" || ARGV[0] == "--help" || ARGV[0] == "-?"
    ARGV.unshift("compile")
    ARGV.unshift("help")
  elsif ARGV[0] != "compile" # default to generate if nothing else passed
    ARGV.unshift("compile")
  end

  Ctpl::Generate.start(ARGV)
rescue Exception => e
  puts e
  if ARGV.include?('-v') || ARGV.include?('--verbose')
    puts e.backtrace.join("\n")
  end

  exit 1
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ctpl-0.0.6 bin/ctpl
ctpl-0.0.5 bin/ctpl
ctpl-0.0.4 bin/ctpl