Files
chromebrew/lib/fixup.rb
Satadru Pramanik, DO, MPH, MEng fc43ffde1e fixup install.sh path insertion, Adds fixup section to crew to run during crew update. (#8807)
* fixup install.sh path insertion

* Add version to path env.d file

* add fixups.rb

* add more verbose comment

* change require to load

* change fixup path

* change fixup path

* bump version

* add more verbose message to fixup.rb

* fix escaping

* bump version

* add crew version check in fixup

* fixup

* fixup

* fixup

* Make LD_LIBRARY_PATH setting i686 only

* remove musl path from installer

* suggested changes

* suggested changes
2023-10-19 21:35:05 -05:00

15 lines
616 B
Ruby

# Add fixups to be run during crew update here.
# remove deprecated directory
FileUtils.rm_rf "#{HOME}/.cache/crewcache/manifest"
# Fix missing $PATH not added in install.sh
if !system("grep -q '$PATH' #{CREW_PREFIX}/etc/env.d/path") || Gem::Version.new(CREW_VERSION.to_s) < Gem::Version.new('1.36.4')
puts 'Fixing path env.d file...'.orange
puts "Please run 'source ~/.bashrc'".lightblue
File.write "#{CREW_PREFIX}/etc/env.d/path", <<~ENVD_PATH_EOF
## Inserted by Chromebrew version #{CREW_VERSION}
PATH=#{CREW_PREFIX}/bin:#{CREW_PREFIX}/sbin:#{CREW_PREFIX}/share/musl/bin:$PATH
ENVD_PATH_EOF
end