Sha256: 165e49a1c557542d3554042da906897781c4e8f1195df42b8d822a748f4356b2
Contents?: true
Size: 979 Bytes
Versions: 152
Compression:
Stored size: 979 Bytes
Contents
function bundle_clean() { ruby_version="$(ruby -v | grep -o '[0-9]\.[0-9]\.[0-9]')" if [ -d vendor/bundle ]; then chmod og+r -R vendor/bundle # some gems have broken perms # some cleanup rm -rf vendor/bundle/ruby/${ruby_version}/cache rm -rf vendor/bundle/ruby/${ruby_version}/gems/*/{test,spec,examples,example,contrib,doc,ext,sample} fi } # Remove files from the current directory that also exist in another given # directory. For example, say in the current directory there is: # foo # bar/baz # bar/xyzzy # bacon # people/phlebas # and in dir2 there is # bacon # alice # people/phlebas # bar/xyzzy # then after running `remove_matching dir2` current directory will be left with only: # foo # bar/baz # Note it probably isn't 100% fool-proof, so don't launch it out to space or something. function remove_matching() { find "$1" -type f -print0 | sed -ze "s@^$1@.@" | xargs -0 rm -f find . -type d -empty -delete }
Version data entries
152 entries across 152 versions & 1 rubygems