Skip to content

Commit

Permalink
add prune-gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperChalice committed Nov 8, 2023
1 parent b4966c2 commit cf5425d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/prune-gcc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

require "formula"
require "open-uri"

module Homebrew
module_function

def prune_gcc
gcc = Formula["gcc"]

gcc.prefix.children.each do |f|
rm_rf f unless f.to_s.end_with? "lib"
end

(gcc.lib/"gcc").children.each do |f|
rm_rf f unless f.to_s.end_with? "current"
end

(gcc.lib/"gcc/current").children.each do |f|
rm_rf f unless f.to_s.end_with? ".dylib"
end
end
end

0 comments on commit cf5425d

Please sign in to comment.