Sha256: 5df2bdc07e21a3e9516ed1094e1633bf8976e8664cbd6cdf721658955fe4d354
Contents?: true
Size: 1.19 KB
Versions: 62
Compression:
Stored size: 1.19 KB
Contents
#!/usr/bin/env ruby # This is used to boot the generator in an environment with no # Origen application loaded. # This emulates how it will run when generating an app and means # that any unintended dependencies on a real app environment will # be highlighted during test. $LOAD_PATH.unshift ARGV.shift $LOAD_PATH.unshift ARGV.shift $LOAD_PATH.unshift ARGV.shift require 'fileutils' require 'origen' # Prevent the bundle from loading by running this outside of the if Origen.os.windows? tmp_dir = 'C:/tmp/my_app_generators/new_app' else tmp_dir = '/tmp/my_app_generators/new_app' end FileUtils.rm_rf tmp_dir if File.exist?(tmp_dir) FileUtils.mkdir_p tmp_dir begin Dir.chdir tmp_dir do # For some reason this is not being defined by require origen anymore User = Origen::Users::User unless defined? User require 'origen_app_generators' load_generators = ARGV.shift OrigenAppGenerators.unload_generators unless ARGV[0] require load_generators if File.exist?(load_generators) OrigenAppGenerators.invoke('my_app') end ensure FileUtils.mv "#{tmp_dir}/my_app", 'output' if File.exist?("#{tmp_dir}/my_app") puts puts "Ignore the above, your new app is in: output/my_app" end
Version data entries
62 entries across 62 versions & 2 rubygems