#!/usr/pkg/bin/ruby34
require 'padrino-core/cli/binstub'
Padrino.replace_with_binstub('padrino-gen')

padrino_gen_path = File.expand_path('../lib', __dir__)
$LOAD_PATH.unshift(padrino_gen_path) if File.directory?(padrino_gen_path) && !$LOAD_PATH.include?(padrino_gen_path)

# We try to load the vendored padrino-core if exist (useful also for --dev mode)
padrino_core_path = File.expand_path('../../padrino-core/lib', __dir__)
$LOAD_PATH.unshift(padrino_core_path) if File.directory?(padrino_core_path) && !$LOAD_PATH.include?(padrino_core_path)

require 'padrino-gen'
require 'padrino-gen/generators/cli'

# We need our config boot because we need to load registered generators so:
Padrino::Generators::Cli.start(ARGV)
