Skip to content

Commit

Permalink
(puppetlabsGH-2291) Add bootsnap
Browse files Browse the repository at this point in the history
!no-release-note
  • Loading branch information
beechtom committed Jun 30, 2021
1 parent f49e0aa commit d071825
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions bolt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "addressable", '~> 2.5'
spec.add_dependency "aws-sdk-ec2", '~> 1'
spec.add_dependency "bootsnap", "~> 1.7"
spec.add_dependency "CFPropertyList", "~> 2.2"
spec.add_dependency "concurrent-ruby", "~> 1.0"
spec.add_dependency "ffi", "< 1.14.0"
Expand Down
20 changes: 20 additions & 0 deletions exe/bolt
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

ENV['BOOTSNAP_CACHE_DIR'] = begin
if RbConfig::CONFIG['host_os'] =~/mswin|mingw|cygwin/
File.join(ENV['ProgramData'], 'Puppetlabs', 'bolt')
else
File.expand_path('~/.puppetlabs/etc/bolt')
end
rescue StandardError; end

unless ENV['BOOTSNAP_CACHE_DIR']
require 'bootsnap'

Bootsnap.setup(
cache_dir: ENV['BOOTSNAP_CACHE_DIR'],
development_mode: false,
load_path_cache: true,
compile_cache_iseq: true,
compile_cache_yaml: false
)
end

require 'bolt'
require 'bolt/cli'

Expand Down

0 comments on commit d071825

Please sign in to comment.