fixup: don't add path because crew_profile_base should provide it. (#9342)

* fixup: don't add path because crew_profile_base should provide it.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fixup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-02-15 11:06:11 -05:00
committed by GitHub
parent 7103e3f57d
commit 38d166bbc2

View File

@@ -4,24 +4,8 @@
# remove deprecated directory
FileUtils.rm_rf "#{HOME}/.cache/crewcache/manifest"
# Fix missing $PATH not added in install.sh
@need_path = false
if !File.file?("#{CREW_PREFIX}/etc/env.d/path")
@need_path = true
elsif !system("grep -q '$PATH' #{CREW_PREFIX}/etc/env.d/path") || Gem::Version.new(CREW_VERSION.to_s) < Gem::Version.new('1.36.4')
@need_path = true
end
if @need_path
FileUtils.mkdir_p "#{CREW_PREFIX}/etc/env.d"
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
ExitMessage.add "Fixed path env.d file...\nPlease run 'source ~/.bashrc'".orange
end
# Remove install.sh provided path file since we supersede it.
if File.exist?("#{CREW_PREFIX}/etc/env.d/00-path")
if File.exist?("#{CREW_PREFIX}/etc/env.d/00-path") && File.exist?("#{CREW_PREFIX}/etc/env.d/path")
puts "Removing #{CREW_PREFIX}/etc/env.d/path installed by the Chromebrew installer.\n".orange
FileUtils.rm "#{CREW_PREFIX}/etc/env.d/path"
end