Skip to content

Commit a766d6b

Browse files
chore: add app_id if provided (#3705)
* chore: add app_id if provided * Update lib/generators/avo/install_generator.rb --------- Co-authored-by: Paul Bob <[email protected]>
1 parent a799ac4 commit a766d6b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/generators/avo/install_generator.rb

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class InstallGenerator < BaseGenerator
88
namespace "avo:install"
99
desc "Creates an Avo initializer adds the route to the routes file."
1010
class_option :path, type: :string, default: "avo"
11+
class_option :"app-id", type: :string
1112

1213
def create_initializer_file
1314
route "mount_avo"
@@ -24,6 +25,10 @@ def create_resources
2425
end
2526
end
2627

28+
def app_id
29+
options[:"app-id"]
30+
end
31+
2732
if defined?(Account) && Account.is_a?(ActiveRecord::Base)
2833
Rails::Generators.invoke("avo:resource", ["account", "-q"], {destination_root: Rails.root })
2934
end

lib/generators/avo/templates/initializer/avo.tt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Avo.configure do |config|
1010
# config.home_path = nil
1111

1212
## == Licensing ==
13-
# config.license_key = ENV['AVO_LICENSE_KEY']
13+
<%= "# " if !app_id.present? %>config.license_key = ENV['AVO_LICENSE_KEY']
1414

1515
## == Set the context ==
1616
config.set_context do

0 commit comments

Comments
 (0)