diff --git a/lib/fixup.rb b/lib/fixup.rb index 795933a88..847384d08 100644 --- a/lib/fixup.rb +++ b/lib/fixup.rb @@ -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