#!/usr/bin/env ruby # -*- mode: ruby -*- if File.exists?('lux-fw.gemspec') puts 'Cant run in lux folder' exit end require 'thor' require 'colorize' require 'optparse' require 'awesome_print' require 'dotenv' Dotenv.load LUX_ROOT = File.expand_path '../..', __FILE__ puts 'Lux (%s, v%s)' % [LUX_ROOT, File.read('%s/.version' % LUX_ROOT)] unless ARGV[0] ### module Cli extend self def run what puts what.green system what end def die text puts text.red exit end def info text puts '* %s' % text.magenta end end ### trap("SIGINT") { Cli.die 'ctrl+c exit' } LuxCli = Class.new Thor Dir['%s/bin/cli/*.rb' % LUX_ROOT].each { |it| load it } LuxCli.start ARGV rakes = Dir['./Rakefile*'] + Dir['./rakefile*'] if !ARGV[0] && rakes[0] puts 'Or use one of rake tasks' puts ' ' + `rake -T`.gsub($/, "\n ") end